<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head>

<meta charset="utf-8">
<meta name="generator" content="quarto-99.9.9">

<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">


<title>Fastmath documentation – Special functions</title>
<style>
code{white-space: pre-wrap;}
span.smallcaps{font-variant: small-caps;}
div.columns{display: flex; gap: min(4vw, 1.5em);}
div.column{flex: auto; overflow-x: auto;}
div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
ul.task-list{list-style: none;}
ul.task-list li input[type="checkbox"] {
  width: 0.8em;
  margin: 0 0.8em 0.2em -1em; /* quarto-specific, see https://github.com/quarto-dev/quarto-cli/issues/4556 */ 
  vertical-align: middle;
}
/* CSS for syntax highlighting */
pre > code.sourceCode { white-space: pre; position: relative; }
pre > code.sourceCode > span { line-height: 1.25; }
pre > code.sourceCode > span:empty { height: 1.2em; }
.sourceCode { overflow: visible; }
code.sourceCode > span { color: inherit; text-decoration: inherit; }
div.sourceCode { margin: 1em 0; }
pre.sourceCode { margin: 0; }
@media screen {
div.sourceCode { overflow: auto; }
}
@media print {
pre > code.sourceCode { white-space: pre-wrap; }
pre > code.sourceCode > span { text-indent: -5em; padding-left: 5em; }
}
pre.numberSource code
  { counter-reset: source-line 0; }
pre.numberSource code > span
  { position: relative; left: -4em; counter-increment: source-line; }
pre.numberSource code > span > a:first-child::before
  { content: counter(source-line);
    position: relative; left: -1em; text-align: right; vertical-align: baseline;
    border: none; display: inline-block;
    -webkit-touch-callout: none; -webkit-user-select: none;
    -khtml-user-select: none; -moz-user-select: none;
    -ms-user-select: none; user-select: none;
    padding: 0 4px; width: 4em;
  }
pre.numberSource { margin-left: 3em;  padding-left: 4px; }
div.sourceCode
  {   }
@media screen {
pre > code.sourceCode > span > a:first-child::before { text-decoration: underline; }
}
</style>


<script src="site_libs/quarto-nav/quarto-nav.js"></script>
<script src="site_libs/quarto-nav/headroom.min.js"></script>
<script src="site_libs/clipboard/clipboard.min.js"></script>
<script src="site_libs/quarto-search/autocomplete.umd.js"></script>
<script src="site_libs/quarto-search/fuse.min.js"></script>
<script src="site_libs/quarto-search/quarto-search.js"></script>
<meta name="quarto:offset" content="./">
<link href="./calculus.html" rel="next">
<link href="./polynomials.html" rel="prev">
<link href="./clay/resources/favicon.png" rel="icon" type="image/png">
<script src="site_libs/quarto-html/quarto.js"></script>
<script src="site_libs/quarto-html/popper.min.js"></script>
<script src="site_libs/quarto-html/tippy.umd.min.js"></script>
<script src="site_libs/quarto-html/anchor.min.js"></script>
<link href="site_libs/quarto-html/tippy.css" rel="stylesheet">
<link href="site_libs/quarto-html/quarto-syntax-highlighting.css" rel="stylesheet" id="quarto-text-highlighting-styles">
<script src="site_libs/bootstrap/bootstrap.min.js"></script>
<link href="site_libs/bootstrap/bootstrap-icons.css" rel="stylesheet">
<link href="site_libs/bootstrap/bootstrap.min.css" rel="stylesheet" id="quarto-bootstrap" data-mode="light">
<script id="quarto-search-options" type="application/json">{
  "location": "sidebar",
  "copy-button": false,
  "collapse-after": 3,
  "panel-placement": "start",
  "type": "textbox",
  "limit": 50,
  "keyboard-shortcut": [
    "f",
    "/",
    "s"
  ],
  "show-item-context": false,
  "language": {
    "search-no-results-text": "No results",
    "search-matching-documents-text": "matching documents",
    "search-copy-link-title": "Copy link to search",
    "search-hide-matches-text": "Hide additional matches",
    "search-more-match-text": "more match in this document",
    "search-more-matches-text": "more matches in this document",
    "search-clear-button-title": "Clear",
    "search-text-placeholder": "",
    "search-detached-cancel-button-title": "Cancel",
    "search-submit-button-title": "Submit",
    "search-label": "Search"
  }
}</script>

  <script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
  <script src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml-full.js" type="text/javascript"></script>

<script type="text/javascript">
const typesetMath = (el) => {
  if (window.MathJax) {
    // MathJax Typeset
    window.MathJax.typeset([el]);
  } else if (window.katex) {
    // KaTeX Render
    var mathElements = el.getElementsByClassName("math");
    var macros = [];
    for (var i = 0; i < mathElements.length; i++) {
      var texText = mathElements[i].firstChild;
      if (mathElements[i].tagName == "SPAN") {
        window.katex.render(texText.data, mathElements[i], {
          displayMode: mathElements[i].classList.contains('display'),
          throwOnError: false,
          macros: macros,
          fleqn: false
        });
      }
    }
  }
}
window.Quarto = {
  typesetMath
};
</script>

</head>

<body class="nav-sidebar floating">

<div id="quarto-search-results"></div>
  <header id="quarto-header" class="headroom fixed-top">
  <nav class="quarto-secondary-nav">
    <div class="container-fluid d-flex">
      <button type="button" class="quarto-btn-toggle btn" data-bs-toggle="collapse" data-bs-target=".quarto-sidebar-collapse-item" aria-controls="quarto-sidebar" aria-expanded="false" aria-label="Toggle sidebar navigation" onclick="if (window.quartoToggleHeadroom) { window.quartoToggleHeadroom(); }">
        <i class="bi bi-layout-text-sidebar-reverse"></i>
      </button>
        <nav class="quarto-page-breadcrumbs" aria-label="breadcrumb"><ol class="breadcrumb"><li class="breadcrumb-item"><a href="./special.html">Special functions</a></li></ol></nav>
        <a class="flex-grow-1" role="button" data-bs-toggle="collapse" data-bs-target=".quarto-sidebar-collapse-item" aria-controls="quarto-sidebar" aria-expanded="false" aria-label="Toggle sidebar navigation" onclick="if (window.quartoToggleHeadroom) { window.quartoToggleHeadroom(); }">      
        </a>
      <button type="button" class="btn quarto-search-button" aria-label="" onclick="window.quartoOpenSearch();">
        <i class="bi bi-search"></i>
      </button>
    </div>
  </nav>
</header>
<!-- content -->
<div id="quarto-content" class="quarto-container page-columns page-rows-contents page-layout-article">
<!-- sidebar -->
  <nav id="quarto-sidebar" class="sidebar collapse collapse-horizontal quarto-sidebar-collapse-item sidebar-navigation floating overflow-auto">
    <div class="pt-lg-2 mt-2 text-left sidebar-header">
    <div class="sidebar-title mb-0 py-0">
      <a href="./">Fastmath documentation</a> 
    </div>
      </div>
        <div class="mt-2 flex-shrink-0 align-items-center">
        <div class="sidebar-search">
        <div id="quarto-search" class="" title="Search"></div>
        </div>
        </div>
    <div class="sidebar-menu-container"> 
    <ul class="list-unstyled mt-1">
        <li class="sidebar-item">
  <div class="sidebar-item-container"> 
  <a href="./index.html" class="sidebar-item-text sidebar-link">
 <span class="menu-text">Preface</span></a>
  </div>
</li>
        <li class="sidebar-item">
  <div class="sidebar-item-container"> 
  <a href="./core.html" class="sidebar-item-text sidebar-link">
 <span class="menu-text">Core</span></a>
  </div>
</li>
        <li class="sidebar-item">
  <div class="sidebar-item-container"> 
  <a href="./vector_matrix.html" class="sidebar-item-text sidebar-link">
 <span class="menu-text">Vectors and matrices</span></a>
  </div>
</li>
        <li class="sidebar-item">
  <div class="sidebar-item-container"> 
  <a href="./random.html" class="sidebar-item-text sidebar-link">
 <span class="menu-text">Random</span></a>
  </div>
</li>
        <li class="sidebar-item">
  <div class="sidebar-item-container"> 
  <a href="./stats.html" class="sidebar-item-text sidebar-link">
 <span class="menu-text">Statistics</span></a>
  </div>
</li>
        <li class="sidebar-item">
  <div class="sidebar-item-container"> 
  <a href="./polynomials.html" class="sidebar-item-text sidebar-link">
 <span class="menu-text">Polynomials</span></a>
  </div>
</li>
        <li class="sidebar-item">
  <div class="sidebar-item-container"> 
  <a href="./special.html" class="sidebar-item-text sidebar-link active">
 <span class="menu-text">Special functions</span></a>
  </div>
</li>
        <li class="sidebar-item">
  <div class="sidebar-item-container"> 
  <a href="./calculus.html" class="sidebar-item-text sidebar-link">
 <span class="menu-text">Calculus</span></a>
  </div>
</li>
        <li class="sidebar-item">
  <div class="sidebar-item-container"> 
  <a href="./interpolation.html" class="sidebar-item-text sidebar-link">
 <span class="menu-text">Interpolation</span></a>
  </div>
</li>
        <li class="sidebar-item">
  <div class="sidebar-item-container"> 
  <a href="./optimization.html" class="sidebar-item-text sidebar-link">
 <span class="menu-text">Optimization</span></a>
  </div>
</li>
        <li class="sidebar-item">
  <div class="sidebar-item-container"> 
  <a href="./transform.html" class="sidebar-item-text sidebar-link">
 <span class="menu-text">Transforms</span></a>
  </div>
</li>
        <li class="sidebar-item">
  <div class="sidebar-item-container"> 
  <a href="./ml.html" class="sidebar-item-text sidebar-link">
 <span class="menu-text">Machine Learning</span></a>
  </div>
</li>
        <li class="sidebar-item">
  <div class="sidebar-item-container"> 
  <a href="./complex_quaternions.html" class="sidebar-item-text sidebar-link">
 <span class="menu-text">Complex numbers and quaternions</span></a>
  </div>
</li>
        <li class="sidebar-item">
  <div class="sidebar-item-container"> 
  <a href="./easings.html" class="sidebar-item-text sidebar-link">
 <span class="menu-text">Easings</span></a>
  </div>
</li>
        <li class="sidebar-item">
  <div class="sidebar-item-container"> 
  <a href="./fields.html" class="sidebar-item-text sidebar-link">
 <span class="menu-text">Vector fields</span></a>
  </div>
</li>
        <li class="sidebar-item">
  <div class="sidebar-item-container"> 
  <a href="./efloat.html" class="sidebar-item-text sidebar-link">
 <span class="menu-text">EFloat</span></a>
  </div>
</li>
    </ul>
    </div>
</nav>
<div id="quarto-sidebar-glass" class="quarto-sidebar-collapse-item" data-bs-toggle="collapse" data-bs-target=".quarto-sidebar-collapse-item"></div>
<!-- margin-sidebar -->
    <div id="quarto-margin-sidebar" class="sidebar margin-sidebar">
        <nav id="TOC" role="doc-toc" class="toc-active">
    <h2 id="toc-title">Table of contents</h2>
   
  <ul>
  <li><a href="#gamma" id="toc-gamma" class="nav-link active" data-scroll-target="#gamma">Gamma</a>
  <ul>
  <li><a href="#gamma-function" id="toc-gamma-function" class="nav-link" data-scroll-target="#gamma-function">Gamma function</a></li>
  <li><a href="#log-gamma" id="toc-log-gamma" class="nav-link" data-scroll-target="#log-gamma">Log gamma</a></li>
  <li><a href="#incomplete-and-regularized" id="toc-incomplete-and-regularized" class="nav-link" data-scroll-target="#incomplete-and-regularized">Incomplete and regularized</a></li>
  </ul></li>
  <li><a href="#beta" id="toc-beta" class="nav-link" data-scroll-target="#beta">Beta</a>
  <ul>
  <li><a href="#beta-function" id="toc-beta-function" class="nav-link" data-scroll-target="#beta-function">Beta function</a></li>
  <li><a href="#incomplete-and-regularized-1" id="toc-incomplete-and-regularized-1" class="nav-link" data-scroll-target="#incomplete-and-regularized-1">Incomplete and regularized</a></li>
  </ul></li>
  <li><a href="#bessel" id="toc-bessel" class="nav-link" data-scroll-target="#bessel">Bessel</a>
  <ul>
  <li><a href="#bessel-j-j" id="toc-bessel-j-j" class="nav-link" data-scroll-target="#bessel-j-j">Bessel J, j</a></li>
  <li><a href="#bessel-y-y" id="toc-bessel-y-y" class="nav-link" data-scroll-target="#bessel-y-y">Bessel Y, y</a></li>
  <li><a href="#bessel-i-i" id="toc-bessel-i-i" class="nav-link" data-scroll-target="#bessel-i-i">Bessel I, i</a></li>
  <li><a href="#bessel-k-k" id="toc-bessel-k-k" class="nav-link" data-scroll-target="#bessel-k-k">Bessel K, k</a></li>
  </ul></li>
  <li><a href="#erf" id="toc-erf" class="nav-link" data-scroll-target="#erf">Erf</a></li>
  <li><a href="#airy" id="toc-airy" class="nav-link" data-scroll-target="#airy">Airy</a></li>
  <li><a href="#integrals" id="toc-integrals" class="nav-link" data-scroll-target="#integrals">Integrals</a>
  <ul>
  <li><a href="#trigonometric" id="toc-trigonometric" class="nav-link" data-scroll-target="#trigonometric">Trigonometric</a></li>
  <li><a href="#exponential" id="toc-exponential" class="nav-link" data-scroll-target="#exponential">Exponential</a></li>
  <li><a href="#logarithmic" id="toc-logarithmic" class="nav-link" data-scroll-target="#logarithmic">Logarithmic</a></li>
  </ul></li>
  <li><a href="#zeta" id="toc-zeta" class="nav-link" data-scroll-target="#zeta">Zeta</a>
  <ul>
  <li><a href="#riemann-zeta" id="toc-riemann-zeta" class="nav-link" data-scroll-target="#riemann-zeta">Riemann zeta</a></li>
  <li><a href="#hurwitz-zeta" id="toc-hurwitz-zeta" class="nav-link" data-scroll-target="#hurwitz-zeta">Hurwitz zeta</a></li>
  <li><a href="#xi" id="toc-xi" class="nav-link" data-scroll-target="#xi">xi</a></li>
  <li><a href="#eta" id="toc-eta" class="nav-link" data-scroll-target="#eta">eta</a></li>
  <li><a href="#beta-1" id="toc-beta-1" class="nav-link" data-scroll-target="#beta-1">beta</a></li>
  </ul></li>
  <li><a href="#hypergeometric" id="toc-hypergeometric" class="nav-link" data-scroll-target="#hypergeometric">Hypergeometric</a>
  <ul>
  <li><a href="#pfq-generalized" id="toc-pfq-generalized" class="nav-link" data-scroll-target="#pfq-generalized"><sub>p</sub>F<sub>q</sub>, generalized</a></li>
  <li><a href="#f0-exp" id="toc-f0-exp" class="nav-link" data-scroll-target="#f0-exp"><sub>0</sub>F<sub>0</sub>, exp</a></li>
  <li><a href="#f1" id="toc-f1" class="nav-link" data-scroll-target="#f1"><sub>0</sub>F<sub>1</sub></a></li>
  <li><a href="#f2" id="toc-f2" class="nav-link" data-scroll-target="#f2"><sub>0</sub>F<sub>2</sub></a></li>
  <li><a href="#f0" id="toc-f0" class="nav-link" data-scroll-target="#f0"><sub>1</sub>F<sub>0</sub></a></li>
  <li><a href="#f1-m" id="toc-f1-m" class="nav-link" data-scroll-target="#f1-m"><sub>1</sub>F<sub>1</sub>, M</a></li>
  <li><a href="#f0-u" id="toc-f0-u" class="nav-link" data-scroll-target="#f0-u"><sub>2</sub>F<sub>0</sub>, U</a></li>
  <li><a href="#f1-gauss" id="toc-f1-gauss" class="nav-link" data-scroll-target="#f1-gauss"><sub>2</sub>F<sub>1</sub>, Gauss</a></li>
  <li><a href="#whittaker-m-and-w" id="toc-whittaker-m-and-w" class="nav-link" data-scroll-target="#whittaker-m-and-w">Whittaker M and W</a></li>
  </ul></li>
  <li><a href="#other" id="toc-other" class="nav-link" data-scroll-target="#other">Other</a>
  <ul>
  <li><a href="#lambert-w" id="toc-lambert-w" class="nav-link" data-scroll-target="#lambert-w">Lambert W</a></li>
  <li><a href="#harmonic-h" id="toc-harmonic-h" class="nav-link" data-scroll-target="#harmonic-h">Harmonic H</a></li>
  <li><a href="#minowski" id="toc-minowski" class="nav-link" data-scroll-target="#minowski">Minowski</a></li>
  </ul></li>
  <li><a href="#reference" id="toc-reference" class="nav-link" data-scroll-target="#reference">Reference</a>
  <ul>
  <li><a href="#fastmath.special" id="toc-fastmath.special" class="nav-link" data-scroll-target="#fastmath.special">fastmath.special</a>
  <ul>
  <li><a href="#ci" id="toc-ci" class="nav-link" data-scroll-target="#ci">Ci</a></li>
  <li><a href="#cin" id="toc-cin" class="nav-link" data-scroll-target="#cin">Cin</a></li>
  <li><a href="#e0" id="toc-e0" class="nav-link" data-scroll-target="#e0">E0</a></li>
  <li><a href="#e1" id="toc-e1" class="nav-link" data-scroll-target="#e1">E1</a></li>
  <li><a href="#ei" id="toc-ei" class="nav-link" data-scroll-target="#ei">Ei</a></li>
  <li><a href="#ein" id="toc-ein" class="nav-link" data-scroll-target="#ein">Ein</a></li>
  <li><a href="#en" id="toc-en" class="nav-link" data-scroll-target="#en">En</a></li>
  <li><a href="#li" id="toc-li" class="nav-link" data-scroll-target="#li">Li</a></li>
  <li><a href="#si" id="toc-si" class="nav-link" data-scroll-target="#si">Si</a></li>
  <li><a href="#airy-ai" id="toc-airy-ai" class="nav-link" data-scroll-target="#airy-ai">airy-Ai</a></li>
  <li><a href="#airy-ai-1" id="toc-airy-ai-1" class="nav-link" data-scroll-target="#airy-ai-1">airy-Ai’</a></li>
  <li><a href="#airy-bi" id="toc-airy-bi" class="nav-link" data-scroll-target="#airy-bi">airy-Bi</a></li>
  <li><a href="#airy-bi-1" id="toc-airy-bi-1" class="nav-link" data-scroll-target="#airy-bi-1">airy-Bi’</a></li>
  <li><a href="#bessel-i" id="toc-bessel-i" class="nav-link" data-scroll-target="#bessel-i">bessel-I</a></li>
  <li><a href="#bessel-i0" id="toc-bessel-i0" class="nav-link" data-scroll-target="#bessel-i0">bessel-I0</a></li>
  <li><a href="#bessel-i1" id="toc-bessel-i1" class="nav-link" data-scroll-target="#bessel-i1">bessel-I1</a></li>
  <li><a href="#bessel-j" id="toc-bessel-j" class="nav-link" data-scroll-target="#bessel-j">bessel-J</a></li>
  <li><a href="#bessel-j0" id="toc-bessel-j0" class="nav-link" data-scroll-target="#bessel-j0">bessel-J0</a></li>
  <li><a href="#bessel-j1" id="toc-bessel-j1" class="nav-link" data-scroll-target="#bessel-j1">bessel-J1</a></li>
  <li><a href="#bessel-k" id="toc-bessel-k" class="nav-link" data-scroll-target="#bessel-k">bessel-K</a></li>
  <li><a href="#bessel-k-half-odd" id="toc-bessel-k-half-odd" class="nav-link" data-scroll-target="#bessel-k-half-odd">bessel-K-half-odd</a></li>
  <li><a href="#bessel-k0" id="toc-bessel-k0" class="nav-link" data-scroll-target="#bessel-k0">bessel-K0</a></li>
  <li><a href="#bessel-k1" id="toc-bessel-k1" class="nav-link" data-scroll-target="#bessel-k1">bessel-K1</a></li>
  <li><a href="#bessel-y" id="toc-bessel-y" class="nav-link" data-scroll-target="#bessel-y">bessel-Y</a></li>
  <li><a href="#bessel-y0" id="toc-bessel-y0" class="nav-link" data-scroll-target="#bessel-y0">bessel-Y0</a></li>
  <li><a href="#bessel-y1" id="toc-bessel-y1" class="nav-link" data-scroll-target="#bessel-y1">bessel-Y1</a></li>
  <li><a href="#beta-2" id="toc-beta-2" class="nav-link" data-scroll-target="#beta-2">beta</a></li>
  <li><a href="#digamma" id="toc-digamma" class="nav-link" data-scroll-target="#digamma">digamma</a></li>
  <li><a href="#dirichlet-beta" id="toc-dirichlet-beta" class="nav-link" data-scroll-target="#dirichlet-beta">dirichlet-beta</a></li>
  <li><a href="#erf-1" id="toc-erf-1" class="nav-link" data-scroll-target="#erf-1">erf</a></li>
  <li><a href="#erfc" id="toc-erfc" class="nav-link" data-scroll-target="#erfc">erfc</a></li>
  <li><a href="#eta-1" id="toc-eta-1" class="nav-link" data-scroll-target="#eta-1">eta</a></li>
  <li><a href="#gamma-1" id="toc-gamma-1" class="nav-link" data-scroll-target="#gamma-1">gamma</a></li>
  <li><a href="#harmonic-number" id="toc-harmonic-number" class="nav-link" data-scroll-target="#harmonic-number">harmonic-number</a></li>
  <li><a href="#hypergeometric-0f0" id="toc-hypergeometric-0f0" class="nav-link" data-scroll-target="#hypergeometric-0f0">hypergeometric-0F0</a></li>
  <li><a href="#hypergeometric-0f1" id="toc-hypergeometric-0f1" class="nav-link" data-scroll-target="#hypergeometric-0f1">hypergeometric-0F1</a></li>
  <li><a href="#hypergeometric-0f2" id="toc-hypergeometric-0f2" class="nav-link" data-scroll-target="#hypergeometric-0f2">hypergeometric-0F2</a></li>
  <li><a href="#hypergeometric-1f0" id="toc-hypergeometric-1f0" class="nav-link" data-scroll-target="#hypergeometric-1f0">hypergeometric-1F0</a></li>
  <li><a href="#hypergeometric-1f1" id="toc-hypergeometric-1f1" class="nav-link" data-scroll-target="#hypergeometric-1f1">hypergeometric-1F1</a></li>
  <li><a href="#hypergeometric-2f0" id="toc-hypergeometric-2f0" class="nav-link" data-scroll-target="#hypergeometric-2f0">hypergeometric-2F0</a></li>
  <li><a href="#hypergeometric-2f1" id="toc-hypergeometric-2f1" class="nav-link" data-scroll-target="#hypergeometric-2f1">hypergeometric-2F1</a></li>
  <li><a href="#hypergeometric-pfq" id="toc-hypergeometric-pfq" class="nav-link" data-scroll-target="#hypergeometric-pfq">hypergeometric-pFq</a></li>
  <li><a href="#hypergeometric-pfq-ratio" id="toc-hypergeometric-pfq-ratio" class="nav-link" data-scroll-target="#hypergeometric-pfq-ratio">hypergeometric-pFq-ratio</a></li>
  <li><a href="#incomplete-beta" id="toc-incomplete-beta" class="nav-link" data-scroll-target="#incomplete-beta">incomplete-beta</a></li>
  <li><a href="#inv-erf" id="toc-inv-erf" class="nav-link" data-scroll-target="#inv-erf">inv-erf</a></li>
  <li><a href="#inv-erfc" id="toc-inv-erfc" class="nav-link" data-scroll-target="#inv-erfc">inv-erfc</a></li>
  <li><a href="#inv-gamma-1pm1" id="toc-inv-gamma-1pm1" class="nav-link" data-scroll-target="#inv-gamma-1pm1">inv-gamma-1pm1</a></li>
  <li><a href="#jinc" id="toc-jinc" class="nav-link" data-scroll-target="#jinc">jinc</a></li>
  <li><a href="#kummers-m" id="toc-kummers-m" class="nav-link" data-scroll-target="#kummers-m">kummers-M</a></li>
  <li><a href="#lambert-w-1" id="toc-lambert-w-1" class="nav-link" data-scroll-target="#lambert-w-1">lambert-W</a></li>
  <li><a href="#lambert-w-1-1" id="toc-lambert-w-1-1" class="nav-link" data-scroll-target="#lambert-w-1-1">lambert-W-1</a></li>
  <li><a href="#li-1" id="toc-li-1" class="nav-link" data-scroll-target="#li-1">li</a></li>
  <li><a href="#log-beta" id="toc-log-beta" class="nav-link" data-scroll-target="#log-beta">log-beta</a></li>
  <li><a href="#log-gamma-1" id="toc-log-gamma-1" class="nav-link" data-scroll-target="#log-gamma-1">log-gamma</a></li>
  <li><a href="#log-gamma-1p" id="toc-log-gamma-1p" class="nav-link" data-scroll-target="#log-gamma-1p">log-gamma-1p</a></li>
  <li><a href="#lower-incomplete-gamma" id="toc-lower-incomplete-gamma" class="nav-link" data-scroll-target="#lower-incomplete-gamma">lower-incomplete-gamma</a></li>
  <li><a href="#minkowski" id="toc-minkowski" class="nav-link" data-scroll-target="#minkowski">minkowski</a></li>
  <li><a href="#polygamma" id="toc-polygamma" class="nav-link" data-scroll-target="#polygamma">polygamma</a></li>
  <li><a href="#regularized-beta" id="toc-regularized-beta" class="nav-link" data-scroll-target="#regularized-beta">regularized-beta</a></li>
  <li><a href="#regularized-gamma-p" id="toc-regularized-gamma-p" class="nav-link" data-scroll-target="#regularized-gamma-p">regularized-gamma-p</a></li>
  <li><a href="#regularized-gamma-q" id="toc-regularized-gamma-q" class="nav-link" data-scroll-target="#regularized-gamma-q">regularized-gamma-q</a></li>
  <li><a href="#si-1" id="toc-si-1" class="nav-link" data-scroll-target="#si-1">si</a></li>
  <li><a href="#spherical-bessel-1-i" id="toc-spherical-bessel-1-i" class="nav-link" data-scroll-target="#spherical-bessel-1-i">spherical-bessel-1-i</a></li>
  <li><a href="#spherical-bessel-1-i0" id="toc-spherical-bessel-1-i0" class="nav-link" data-scroll-target="#spherical-bessel-1-i0">spherical-bessel-1-i0</a></li>
  <li><a href="#spherical-bessel-1-i1" id="toc-spherical-bessel-1-i1" class="nav-link" data-scroll-target="#spherical-bessel-1-i1">spherical-bessel-1-i1</a></li>
  <li><a href="#spherical-bessel-1-i2" id="toc-spherical-bessel-1-i2" class="nav-link" data-scroll-target="#spherical-bessel-1-i2">spherical-bessel-1-i2</a></li>
  <li><a href="#spherical-bessel-2-i" id="toc-spherical-bessel-2-i" class="nav-link" data-scroll-target="#spherical-bessel-2-i">spherical-bessel-2-i</a></li>
  <li><a href="#spherical-bessel-2-i0" id="toc-spherical-bessel-2-i0" class="nav-link" data-scroll-target="#spherical-bessel-2-i0">spherical-bessel-2-i0</a></li>
  <li><a href="#spherical-bessel-2-i1" id="toc-spherical-bessel-2-i1" class="nav-link" data-scroll-target="#spherical-bessel-2-i1">spherical-bessel-2-i1</a></li>
  <li><a href="#spherical-bessel-2-i2" id="toc-spherical-bessel-2-i2" class="nav-link" data-scroll-target="#spherical-bessel-2-i2">spherical-bessel-2-i2</a></li>
  <li><a href="#spherical-bessel-j" id="toc-spherical-bessel-j" class="nav-link" data-scroll-target="#spherical-bessel-j">spherical-bessel-j</a></li>
  <li><a href="#spherical-bessel-j0" id="toc-spherical-bessel-j0" class="nav-link" data-scroll-target="#spherical-bessel-j0">spherical-bessel-j0</a></li>
  <li><a href="#spherical-bessel-j1" id="toc-spherical-bessel-j1" class="nav-link" data-scroll-target="#spherical-bessel-j1">spherical-bessel-j1</a></li>
  <li><a href="#spherical-bessel-j2" id="toc-spherical-bessel-j2" class="nav-link" data-scroll-target="#spherical-bessel-j2">spherical-bessel-j2</a></li>
  <li><a href="#spherical-bessel-k" id="toc-spherical-bessel-k" class="nav-link" data-scroll-target="#spherical-bessel-k">spherical-bessel-k</a></li>
  <li><a href="#spherical-bessel-k0" id="toc-spherical-bessel-k0" class="nav-link" data-scroll-target="#spherical-bessel-k0">spherical-bessel-k0</a></li>
  <li><a href="#spherical-bessel-k1" id="toc-spherical-bessel-k1" class="nav-link" data-scroll-target="#spherical-bessel-k1">spherical-bessel-k1</a></li>
  <li><a href="#spherical-bessel-k2" id="toc-spherical-bessel-k2" class="nav-link" data-scroll-target="#spherical-bessel-k2">spherical-bessel-k2</a></li>
  <li><a href="#spherical-bessel-y" id="toc-spherical-bessel-y" class="nav-link" data-scroll-target="#spherical-bessel-y">spherical-bessel-y</a></li>
  <li><a href="#spherical-bessel-y0" id="toc-spherical-bessel-y0" class="nav-link" data-scroll-target="#spherical-bessel-y0">spherical-bessel-y0</a></li>
  <li><a href="#spherical-bessel-y1" id="toc-spherical-bessel-y1" class="nav-link" data-scroll-target="#spherical-bessel-y1">spherical-bessel-y1</a></li>
  <li><a href="#spherical-bessel-y2" id="toc-spherical-bessel-y2" class="nav-link" data-scroll-target="#spherical-bessel-y2">spherical-bessel-y2</a></li>
  <li><a href="#tricomis-u" id="toc-tricomis-u" class="nav-link" data-scroll-target="#tricomis-u">tricomis-U</a></li>
  <li><a href="#trigamma" id="toc-trigamma" class="nav-link" data-scroll-target="#trigamma">trigamma</a></li>
  <li><a href="#upper-incomplete-gamma" id="toc-upper-incomplete-gamma" class="nav-link" data-scroll-target="#upper-incomplete-gamma">upper-incomplete-gamma</a></li>
  <li><a href="#whittaker-m" id="toc-whittaker-m" class="nav-link" data-scroll-target="#whittaker-m">whittaker-M</a></li>
  <li><a href="#whittaker-w" id="toc-whittaker-w" class="nav-link" data-scroll-target="#whittaker-w">whittaker-W</a></li>
  <li><a href="#xi-1" id="toc-xi-1" class="nav-link" data-scroll-target="#xi-1">xi</a></li>
  <li><a href="#zeta-1" id="toc-zeta-1" class="nav-link" data-scroll-target="#zeta-1">zeta</a></li>
  </ul></li>
  </ul></li>
  </ul>
</nav>
    </div>
<!-- main -->
<main class="content" id="quarto-document-content">

<header id="title-block-header" class="quarto-title-block default">
<div class="quarto-title">
<h1 class="title">Special functions</h1>
</div>



<div class="quarto-title-meta">

    
  
    
  </div>
  


</header>


<style></style>
<style>.printedClojure .sourceCode {
  background-color: transparent;
  border-style: none;
}
</style>
<style>.clay-limit-image-width .clay-image {max-width: 100%}
.clay-side-by-side .sourceCode {margin: 0}
.clay-side-by-side {margin: 1em 0}
</style>
<script src="special_files/md-default71.js" type="text/javascript"></script>
<script src="special_files/md-default72.js" type="text/javascript"></script>
<p>Collection of special functions for real arguments and real returned value. Most of the functions are implemented natively in Clojure, some are based on Apache Commons Math.</p>
<p>Native implementation is based on Julia packages (<a href="https://github.com/JuliaMath/SpecialFunctions">SpecialFunctions.jl</a>, <a href="https://github.com/JuliaMath/Bessels.jl">Bessel</a>, <a href="https://github.com/JuliaMath/HypergeometricFunctions.jl">HypergeometricFunctions</a>) or scientific papers and books (<a href="https://dlmf.nist.gov/">NIST</a>, Meshfree Approximation Methods with Matlab by G. E. Fasshauer]).</p>
<div class="sourceClojure">
<div class="sourceCode" id="cb1"><pre class="sourceCode clojure code-with-copy"><code class="sourceCode clojure"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a>(<span class="kw">require</span> '[fastmath.special <span class="at">:as</span> special]</span>
<span id="cb1-2"><a href="#cb1-2" aria-hidden="true" tabindex="-1"></a>         '[fastmath.core <span class="at">:as</span> m])</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
<section id="gamma" class="level2">
<h2 class="anchored" data-anchor-id="gamma">Gamma</h2>
<p>Gamma and related functions</p>
<div class="callout callout-style-default callout-tip callout-titled" title="Defined functions">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Defined functions
</div>
</div>
<div class="callout-body-container callout-body">
<ul>
<li><code>gamma</code>, <code>log-gamma</code></li>
<li><code>inv-gamma-1pm1</code>, <code>log-gamma-1p</code></li>
<li><code>upper-incomplete-gamma</code>, <code>lower-incomplete-gamma</code></li>
<li><code>regularized-gamma-p</code>, <code>regularized-gamma-q</code></li>
<li><code>digamma</code>, <code>trigamma</code>, <code>polygamma</code></li>
</ul>
</div>
</div>
<section id="gamma-function" class="level3">
<h3 class="anchored" data-anchor-id="gamma-function">Gamma function</h3>
<p><code>gamma</code> <span class="math inline">\(\Gamma(x)\)</span> function is an extension of the factorial.</p>
<p><span class="math display">\[\Gamma(x) = \int_0^\infty t^{x-1}e^{-t}\,dt\]</span></p>
<p>For positive integer <code>n</code></p>
<p><span class="math display">\[\Gamma(n) = (n-1)!\]</span></p>
<p>Gamma for negative integers is not defined.</p>
<div class="clay-image">
<img class="clay-image" src="special_files/0.png">
</div>
<div class="callout callout-style-default callout-note callout-titled" title="Examples">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Examples
</div>
</div>
<div class="callout-body-container callout-body">
<div class="sourceClojure">
<div class="sourceCode" id="cb2"><pre class="sourceCode clojure code-with-copy"><code class="sourceCode clojure"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a>(special/gamma <span class="fl">1.5</span>) <span class="co">;; =&gt; 0.886226925452758</span></span>
<span id="cb2-2"><a href="#cb2-2" aria-hidden="true" tabindex="-1"></a>(special/gamma -<span class="fl">1.5</span>) <span class="co">;; =&gt; 2.3632718012073544</span></span>
<span id="cb2-3"><a href="#cb2-3" aria-hidden="true" tabindex="-1"></a>(special/gamma -<span class="fl">2.0</span>) <span class="co">;; =&gt; ##NaN</span></span>
<span id="cb2-4"><a href="#cb2-4" aria-hidden="true" tabindex="-1"></a>(special/gamma <span class="dv">15</span>) <span class="co">;; =&gt; 8.71782912E10</span></span>
<span id="cb2-5"><a href="#cb2-5" aria-hidden="true" tabindex="-1"></a>(m/factorial <span class="dv">14</span>) <span class="co">;; =&gt; 8.71782912E10</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
</div>
</div>
<hr>
<p>Additionally reciprocal gamma function <code>inv-gamma-1pm1</code> is defined as:</p>
<p><span class="math display">\[\frac{1}{\Gamma(x+1)}-1\text{ for } -0.5\leq x\leq 1.5\]</span></p>
<div class="clay-image">
<img class="clay-image" src="special_files/1.png">
</div>
<div class="callout callout-style-default callout-note callout-titled" title="Examples">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Examples
</div>
</div>
<div class="callout-body-container callout-body">
<div class="sourceClojure">
<div class="sourceCode" id="cb3"><pre class="sourceCode clojure code-with-copy"><code class="sourceCode clojure"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a>(special/inv-gamma<span class="dv">-1</span>pm1 -<span class="fl">0.5</span>) <span class="co">;; =&gt; -0.4358104164522437</span></span>
<span id="cb3-2"><a href="#cb3-2" aria-hidden="true" tabindex="-1"></a>(special/inv-gamma<span class="dv">-1</span>pm1 <span class="fl">0.5</span>) <span class="co">;; =&gt; 0.12837916709551256</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
</div>
</div>
</section>
<section id="log-gamma" class="level3">
<h3 class="anchored" data-anchor-id="log-gamma">Log gamma</h3>
<p>Logartihm of gamma <code>log-gamma</code> <span class="math inline">\(\log\Gamma(x)\)</span> with derivatives: <code>digamma</code> <span class="math inline">\(\psi\)</span>, <code>trigamma</code> <span class="math inline">\(\psi_1\)</span> and <code>polygamma</code> <span class="math inline">\(\psi^{(m)}\)</span>.</p>
<div class="clay-image">
<img class="clay-image" src="special_files/2.png">
</div>
<div class="callout callout-style-default callout-note callout-titled" title="Examples">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Examples
</div>
</div>
<div class="callout-body-container callout-body">
<div class="sourceClojure">
<div class="sourceCode" id="cb4"><pre class="sourceCode clojure code-with-copy"><code class="sourceCode clojure"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a>(special/log-gamma <span class="fl">1.01</span>) <span class="co">;; =&gt; -0.005690307946069651</span></span>
<span id="cb4-2"><a href="#cb4-2" aria-hidden="true" tabindex="-1"></a>(special/log-gamma <span class="fl">0.5</span>) <span class="co">;; =&gt; 0.5723649429247001</span></span>
<span id="cb4-3"><a href="#cb4-3" aria-hidden="true" tabindex="-1"></a>(m/exp (special/log-gamma <span class="dv">5</span>)) <span class="co">;; =&gt; 24.000000000000004</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
</div>
</div>
<hr>
<p><code>log-gamma-1p</code> is more accurate function defined as <span class="math inline">\(\log\Gamma(x+1)\)</span> for <span class="math inline">\(-0.5\leq x 1.5\)</span></p>
<div class="clay-image">
<img class="clay-image" src="special_files/3.png">
</div>
<div class="callout callout-style-default callout-note callout-titled" title="Examples">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Examples
</div>
</div>
<div class="callout-body-container callout-body">
<div class="sourceClojure">
<div class="sourceCode" id="cb5"><pre class="sourceCode clojure code-with-copy"><code class="sourceCode clojure"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a>(special/log-gamma<span class="dv">-1</span>p -<span class="fl">0.1</span>) <span class="co">;; =&gt; 0.06637623973474298</span></span>
<span id="cb5-2"><a href="#cb5-2" aria-hidden="true" tabindex="-1"></a>(special/log-gamma<span class="dv">-1</span>p <span class="fl">0.01</span>) <span class="co">;; =&gt; -0.005690307946069646</span></span>
<span id="cb5-3"><a href="#cb5-3" aria-hidden="true" tabindex="-1"></a>(special/log-gamma<span class="dv">-1</span>p <span class="fl">1.01</span>) <span class="co">;; =&gt; 0.004260022907098441</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
</div>
</div>
<hr>
<p>Derivatives of <code>log-gamma</code> function. First derivative <code>digamma</code>.</p>
<p><span class="math display">\[\operatorname{digamma}(x)=\psi(x)=\psi^{(0)}(x)=\frac{d}{dx}\log\Gamma(x)=\frac{\Gamma'(x)}{\Gamma(x)}\]</span></p>
<div class="clay-image">
<img class="clay-image" src="special_files/4.png">
</div>
<hr>
<p>Second derivative <code>trigamma</code></p>
<p><span class="math display">\[\operatorname{trigamma}(x)=\psi_1(x)=\psi^{(1)}(x)=\frac{d}{dx}\psi(x)=\frac{d^2}{dx^2}\log\Gamma(x)\]</span></p>
<div class="clay-image">
<img class="clay-image" src="special_files/5.png">
</div>
<hr>
<p><code>polygamma</code> as m<sup>th</sup> derivative of <code>digamma</code></p>
<p><span class="math display">\[\operatorname{polygamma}(m,x)=\psi^{(m)}=\frac{d^m}{dx^m}\psi(x)=\frac{d^{m+1}}{dx^{m+1}}\log\Gamma(x)\]</span></p>
<div class="clay-image">
<img class="clay-image" src="special_files/6.png">
</div>
<div class="callout callout-style-default callout-note callout-titled" title="Examples">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Examples
</div>
</div>
<div class="callout-body-container callout-body">
<div class="sourceClojure">
<div class="sourceCode" id="cb6"><pre class="sourceCode clojure code-with-copy"><code class="sourceCode clojure"><span id="cb6-1"><a href="#cb6-1" aria-hidden="true" tabindex="-1"></a>(special/digamma <span class="fl">0.5</span>) <span class="co">;; =&gt; -1.9635100260214235</span></span>
<span id="cb6-2"><a href="#cb6-2" aria-hidden="true" tabindex="-1"></a>(special/trigamma <span class="fl">0.5</span>) <span class="co">;; =&gt; 4.93480220054468</span></span>
<span id="cb6-3"><a href="#cb6-3" aria-hidden="true" tabindex="-1"></a>(special/polygamma <span class="dv">0</span> <span class="fl">0.5</span>) <span class="co">;; =&gt; -1.9635100260214235</span></span>
<span id="cb6-4"><a href="#cb6-4" aria-hidden="true" tabindex="-1"></a>(special/polygamma <span class="dv">1</span> <span class="fl">0.5</span>) <span class="co">;; =&gt; 4.93480220054468</span></span>
<span id="cb6-5"><a href="#cb6-5" aria-hidden="true" tabindex="-1"></a>(special/polygamma <span class="dv">2</span> <span class="fl">0.5</span>) <span class="co">;; =&gt; -16.828796644234316</span></span>
<span id="cb6-6"><a href="#cb6-6" aria-hidden="true" tabindex="-1"></a>(special/polygamma <span class="dv">3</span> <span class="fl">0.5</span>) <span class="co">;; =&gt; 97.40909103400247</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
</div>
</div>
</section>
<section id="incomplete-and-regularized" class="level3">
<h3 class="anchored" data-anchor-id="incomplete-and-regularized">Incomplete and regularized</h3>
<p><code>upper-incomplete-gamma</code> <span class="math inline">\(\Gamma(s,x)\)</span> and <code>lower-incomplete-gamma</code> <span class="math inline">\(\gamma(s,x)\)</span> are versions of gamma function with parametrized integral limits.</p>
<p>Upper incomplete gamma is defined as:</p>
<p><span class="math display">\[\Gamma(s,x) = \int_x^\infty t^{s-1}e^{-t}\,dt\]</span></p>
<div class="clay-table">
<div>
<div class="table-responsive">
<table class="table table-hover clay-table" data-quarto-postprocess="true">
<tbody>
<tr class="odd">
<td><img src="special_files/7.png" class="clay-image img-fluid"></td>
<td><img src="special_files/8.png" class="clay-image img-fluid"></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="callout callout-style-default callout-note callout-titled" title="Examples">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Examples
</div>
</div>
<div class="callout-body-container callout-body">
<div class="sourceClojure">
<div class="sourceCode" id="cb7"><pre class="sourceCode clojure code-with-copy"><code class="sourceCode clojure"><span id="cb7-1"><a href="#cb7-1" aria-hidden="true" tabindex="-1"></a>(special/upper-incomplete-gamma <span class="dv">2</span> <span class="fl">0.5</span>) <span class="co">;; =&gt; 0.9097959895689501</span></span>
<span id="cb7-2"><a href="#cb7-2" aria-hidden="true" tabindex="-1"></a>(special/upper-incomplete-gamma -<span class="dv">2</span> <span class="fl">0.5</span>) <span class="co">;; =&gt; 0.886417457100714</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
</div>
</div>
<hr>
<p>Lower incomplete gamma is defined as:</p>
<p><span class="math display">\[\gamma(s,x) = \int_0^x t^{s-1}e^{-t}\,dt\]</span></p>
<div class="clay-table">
<div>
<div class="table-responsive">
<table class="table table-hover clay-table" data-quarto-postprocess="true">
<tbody>
<tr class="odd">
<td><img src="special_files/9.png" class="clay-image img-fluid"></td>
<td><img src="special_files/10.png" class="clay-image img-fluid"></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="callout callout-style-default callout-note callout-titled" title="Examples">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Examples
</div>
</div>
<div class="callout-body-container callout-body">
<div class="sourceClojure">
<div class="sourceCode" id="cb8"><pre class="sourceCode clojure code-with-copy"><code class="sourceCode clojure"><span id="cb8-1"><a href="#cb8-1" aria-hidden="true" tabindex="-1"></a>(special/lower-incomplete-gamma <span class="fl">0.5</span> <span class="dv">3</span>) <span class="co">;; =&gt; 1.7470973415820528</span></span>
<span id="cb8-2"><a href="#cb8-2" aria-hidden="true" tabindex="-1"></a>(special/lower-incomplete-gamma -<span class="fl">0.5</span> <span class="dv">3</span>) <span class="co">;; =&gt; -3.5516838378128024</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
</div>
</div>
<hr>
<p><code>regularized-gamma-p</code> <span class="math inline">\(P(s,x)\)</span> and <code>regularized-gamma-q</code> <span class="math inline">\(Q(s,x)\)</span> are normalized incomplete gamma functions by gamma of <code>s</code>. <code>s</code> can be negative non-integer.</p>
<p><span class="math display">\[P(s,x)=\frac{\gamma(s,x)}{\Gamma(x)}\]</span></p>
<div class="clay-image">
<img class="clay-image" src="special_files/11.png">
</div>
<div class="callout callout-style-default callout-note callout-titled" title="Examples">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Examples
</div>
</div>
<div class="callout-body-container callout-body">
<div class="sourceClojure">
<div class="sourceCode" id="cb9"><pre class="sourceCode clojure code-with-copy"><code class="sourceCode clojure"><span id="cb9-1"><a href="#cb9-1" aria-hidden="true" tabindex="-1"></a>(special/regularized-gamma-p <span class="fl">2.5</span> <span class="fl">0.5</span>) <span class="co">;; =&gt; 0.03743422675270362</span></span>
<span id="cb9-2"><a href="#cb9-2" aria-hidden="true" tabindex="-1"></a>(special/regularized-gamma-p -<span class="fl">2.5</span> <span class="fl">0.5</span>) <span class="co">;; =&gt; 2.134513839251947</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
</div>
</div>
<hr>
<p><span class="math display">\[Q(s,x)=\frac{\Gamma(s,x)}{\Gamma(x)}=1-P(s,x)\]</span></p>
<div class="clay-image">
<img class="clay-image" src="special_files/12.png">
</div>
<div class="callout callout-style-default callout-note callout-titled" title="Examples">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Examples
</div>
</div>
<div class="callout-body-container callout-body">
<div class="sourceClojure">
<div class="sourceCode" id="cb10"><pre class="sourceCode clojure code-with-copy"><code class="sourceCode clojure"><span id="cb10-1"><a href="#cb10-1" aria-hidden="true" tabindex="-1"></a>(special/regularized-gamma-q <span class="fl">2.5</span> <span class="fl">0.5</span>) <span class="co">;; =&gt; 0.9625657732472964</span></span>
<span id="cb10-2"><a href="#cb10-2" aria-hidden="true" tabindex="-1"></a>(special/regularized-gamma-q -<span class="fl">2.5</span> <span class="fl">0.5</span>) <span class="co">;; =&gt; -1.134513839251947</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
</div>
</div>
</section>
</section>
<section id="beta" class="level2">
<h2 class="anchored" data-anchor-id="beta">Beta</h2>
<p>Beta and related functions</p>
<div class="callout callout-style-default callout-tip callout-titled" title="Defined functions">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Defined functions
</div>
</div>
<div class="callout-body-container callout-body">
<ul>
<li><code>beta</code>, <code>log-beta</code></li>
<li><code>incomplete-beta</code>, <code>regularized-beta</code></li>
</ul>
</div>
</div>
<section id="beta-function" class="level3">
<h3 class="anchored" data-anchor-id="beta-function">Beta function</h3>
<p><code>beta</code> <span class="math inline">\(B(p,q)\)</span> function, defined also for negative non-integer <code>p</code> and <code>q</code>.</p>
<p><span class="math display">\[B(p,q) = \int_0^1 t^{p-1}(1-t)^{q-1}\,dt = \frac{\Gamma(p)\Gamma(q)}{\Gamma(p+q)}\]</span></p>
<div class="clay-image">
<img class="clay-image" src="special_files/13.png">
</div>
<div class="callout callout-style-default callout-note callout-titled" title="Examples">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Examples
</div>
</div>
<div class="callout-body-container callout-body">
<div class="sourceClojure">
<div class="sourceCode" id="cb11"><pre class="sourceCode clojure code-with-copy"><code class="sourceCode clojure"><span id="cb11-1"><a href="#cb11-1" aria-hidden="true" tabindex="-1"></a>(special/beta <span class="dv">2</span> <span class="dv">3</span>) <span class="co">;; =&gt; 0.08333333333333334</span></span>
<span id="cb11-2"><a href="#cb11-2" aria-hidden="true" tabindex="-1"></a>(special/beta -<span class="fl">1.2</span> <span class="fl">0.1</span>) <span class="co">;; =&gt; 4.750441365819471</span></span>
<span id="cb11-3"><a href="#cb11-3" aria-hidden="true" tabindex="-1"></a>(special/beta -<span class="fl">1.2</span> -<span class="fl">0.1</span>) <span class="co">;; =&gt; -15.574914582341846</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
</div>
</div>
<hr>
<p><code>log-beta</code> is log of <span class="math inline">\(B(p,q)\)</span> for positive <code>p</code> and <code>q</code></p>
<div class="clay-image">
<img class="clay-image" src="special_files/14.png">
</div>
<div class="callout callout-style-default callout-note callout-titled" title="Examples">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Examples
</div>
</div>
<div class="callout-body-container callout-body">
<div class="sourceClojure">
<div class="sourceCode" id="cb12"><pre class="sourceCode clojure code-with-copy"><code class="sourceCode clojure"><span id="cb12-1"><a href="#cb12-1" aria-hidden="true" tabindex="-1"></a>(special/log-beta <span class="dv">2</span> <span class="dv">3</span>) <span class="co">;; =&gt; -2.4849066497880004</span></span>
<span id="cb12-2"><a href="#cb12-2" aria-hidden="true" tabindex="-1"></a>(special/log-beta <span class="dv">2</span> <span class="dv">3</span>) <span class="co">;; =&gt; -2.4849066497880004</span></span>
<span id="cb12-3"><a href="#cb12-3" aria-hidden="true" tabindex="-1"></a>(m/log (special/beta <span class="dv">2</span> <span class="dv">3</span>)) <span class="co">;; =&gt; -2.4849066497880004</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
</div>
</div>
</section>
<section id="incomplete-and-regularized-1" class="level3">
<h3 class="anchored" data-anchor-id="incomplete-and-regularized-1">Incomplete and regularized</h3>
<p><code>incomplete-beta</code> <span class="math inline">\(B(x,a,b)\)</span> and <code>regularized-beta</code> <span class="math inline">\(I_x(a,b)\)</span>. Both are defined also for negative non-integer <code>a</code> and <code>b</code>.</p>
<p><span class="math display">\[B(x,a,b)=\int_0^x t^{a-1}(1-t)^{b-1}\,dt\]</span></p>
<div class="clay-image">
<img class="clay-image" src="special_files/15.png">
</div>
<div class="callout callout-style-default callout-note callout-titled" title="Examples">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Examples
</div>
</div>
<div class="callout-body-container callout-body">
<div class="sourceClojure">
<div class="sourceCode" id="cb13"><pre class="sourceCode clojure code-with-copy"><code class="sourceCode clojure"><span id="cb13-1"><a href="#cb13-1" aria-hidden="true" tabindex="-1"></a>(special/incomplete-beta <span class="fl">0.5</span> <span class="fl">0.1</span> <span class="fl">0.2</span>) <span class="co">;; =&gt; 9.789912164505285</span></span>
<span id="cb13-2"><a href="#cb13-2" aria-hidden="true" tabindex="-1"></a>(special/incomplete-beta <span class="fl">0.5</span> -<span class="fl">0.1</span> -<span class="fl">0.2</span>) <span class="co">;; =&gt; -9.707992848052843</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
</div>
</div>
<p><span class="math display">\[I_x(a,b)=\frac{B(x,a,b)}{B(a,b)}\]</span></p>
<div class="clay-image">
<img class="clay-image" src="special_files/16.png">
</div>
<div class="callout callout-style-default callout-note callout-titled" title="Examples">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Examples
</div>
</div>
<div class="callout-body-container callout-body">
<div class="sourceClojure">
<div class="sourceCode" id="cb14"><pre class="sourceCode clojure code-with-copy"><code class="sourceCode clojure"><span id="cb14-1"><a href="#cb14-1" aria-hidden="true" tabindex="-1"></a>(special/regularized-beta <span class="fl">0.99</span> -<span class="fl">0.5</span> -<span class="fl">0.7</span>) <span class="co">;; =&gt; 12.086770426418143</span></span>
<span id="cb14-2"><a href="#cb14-2" aria-hidden="true" tabindex="-1"></a>(special/regularized-beta <span class="fl">0.01</span> <span class="fl">0.5</span> <span class="fl">0.5</span>) <span class="co">;; =&gt; 0.06376856085851987</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
</div>
</div>
</section>
</section>
<section id="bessel" class="level2">
<h2 class="anchored" data-anchor-id="bessel">Bessel</h2>
<ul>
<li>Bessel functions of the first (<span class="math inline">\(J_\alpha\)</span>) and the second (<span class="math inline">\(Y_\alpha\)</span>) kind</li>
<li>Modified Bessel functions of the first (<span class="math inline">\(I_\alpha\)</span>) and the second (<span class="math inline">\(K_\alpha\)</span>) kind</li>
<li>Spherical Bessel functions of the first (<span class="math inline">\(j_\alpha\)</span>) and the second (<span class="math inline">\(y_\alpha\)</span>) kind</li>
<li>Modified spherical Bessel functions of the first (<span class="math inline">\(i_\alpha^{(1)}\)</span>, <span class="math inline">\(i_\alpha^{(2)}\)</span>) and the second (<span class="math inline">\(k_\alpha\)</span>) kind</li>
<li>Sombrero function <code>jinc</code></li>
</ul>
<div class="callout callout-style-default callout-tip callout-titled" title="Defined functions">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Defined functions
</div>
</div>
<div class="callout-body-container callout-body">
<ul>
<li><code>bessel-J0</code>, <code>bessel-J1</code>, <code>bessel-J</code>, <code>jinc</code></li>
<li><code>bessel-Y0</code>, <code>bessel-Y1</code>, <code>bessel-Y</code></li>
<li><code>bessel-I0</code>, <code>bessel-I1</code>, <code>bessel-I</code></li>
<li><code>bessel-K0</code>, <code>bessel-K1</code>, <code>bessel-K</code>, <code>bessel-K-half-odd</code></li>
<li><code>spherical-bessel-j0</code>, <code>spherical-bessel-j1</code>, <code>spherical-bessel-j2</code>,<code>spherical-bessel-j</code></li>
<li><code>spherical-bessel-y0</code>, <code>spherical-bessel-y1</code>, <code>spherical-bessel-y2</code>,<code>spherical-bessel-y</code></li>
<li><code>spherical-bessel-1-i0</code>, <code>spherical-bessel-1-i1</code>, <code>spherical-bessel-1-i2</code>,<code>spherical-bessel-1-i</code></li>
<li><code>spherical-bessel-2-i0</code>, <code>spherical-bessel-2-i1</code>, <code>spherical-bessel-2-i2</code>,<code>spherical-bessel-2-1</code></li>
<li><code>spherical-bessel-k0</code>, <code>spherical-bessel-k1</code>, <code>spherical-bessel-k2</code>,<code>spherical-bessel-k</code></li>
</ul>
</div>
</div>
<section id="bessel-j-j" class="level3">
<h3 class="anchored" data-anchor-id="bessel-j-j">Bessel J, j</h3>
<p>Bessel functions of the first kind, <code>bessel-J</code> <span class="math inline">\(J_\alpha(x)\)</span>. <code>bessel-J0</code> and <code>bessel-J1</code> are functions of orders <code>0</code> and <code>1</code>. An order should be integer for negative arguments.</p>
<div class="clay-table">
<div>
<div class="table-responsive">
<table class="table table-hover clay-table" data-quarto-postprocess="true">
<tbody>
<tr class="odd">
<td><img src="special_files/17.png" class="clay-image img-fluid"></td>
<td><img src="special_files/18.png" class="clay-image img-fluid"></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="callout callout-style-default callout-note callout-titled" title="Examples">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Examples
</div>
</div>
<div class="callout-body-container callout-body">
<div class="sourceClojure">
<div class="sourceCode" id="cb15"><pre class="sourceCode clojure code-with-copy"><code class="sourceCode clojure"><span id="cb15-1"><a href="#cb15-1" aria-hidden="true" tabindex="-1"></a>(special/bessel-J0 <span class="fl">2.3</span>) <span class="co">;; =&gt; 0.055539784445602064</span></span>
<span id="cb15-2"><a href="#cb15-2" aria-hidden="true" tabindex="-1"></a>(special/bessel-J1 <span class="fl">2.3</span>) <span class="co">;; =&gt; 0.5398725326043137</span></span>
<span id="cb15-3"><a href="#cb15-3" aria-hidden="true" tabindex="-1"></a>(special/bessel-J <span class="fl">2.1</span> <span class="dv">3</span>) <span class="co">;; =&gt; 0.4761626361699597</span></span>
<span id="cb15-4"><a href="#cb15-4" aria-hidden="true" tabindex="-1"></a>(special/bessel-J -<span class="dv">3</span> -<span class="fl">3.2</span>) <span class="co">;; =&gt; 0.3430663764006682</span></span>
<span id="cb15-5"><a href="#cb15-5" aria-hidden="true" tabindex="-1"></a>(special/bessel-J <span class="dv">3</span> -<span class="fl">3.2</span>) <span class="co">;; =&gt; -0.3430663764006682</span></span>
<span id="cb15-6"><a href="#cb15-6" aria-hidden="true" tabindex="-1"></a>(special/bessel-J -<span class="fl">3.1</span> -<span class="fl">3.2</span>) <span class="co">;; =&gt; ##NaN</span></span>
<span id="cb15-7"><a href="#cb15-7" aria-hidden="true" tabindex="-1"></a>(special/bessel-J <span class="fl">3.1</span> -<span class="fl">3.2</span>) <span class="co">;; =&gt; ##NaN</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
</div>
</div>
<hr>
<p>Spherical Bessel functions of the first kind <code>spherical-bessel-j</code> <span class="math inline">\(j_\alpha(x)\)</span>, <code>spherical-bessel-j0</code>, <code>spherical-bessel-j1</code> and <code>spherical-bessel-j2</code> are functions of orders <code>0</code>,<code>1</code> and <code>2</code>. Functions are defined for positive argument (only functions with orders <code>0</code>, <code>1</code> and <code>2</code> accept non positive argument).</p>
<p><span class="math display">\[j_\alpha(x)=\sqrt{\frac{\pi}{2x}}J_{\alpha+\frac{1}{2}}(x)\]</span></p>
<div class="clay-table">
<div>
<div class="table-responsive">
<table class="table table-hover clay-table" data-quarto-postprocess="true">
<tbody>
<tr class="odd">
<td><img src="special_files/19.png" class="clay-image img-fluid"></td>
<td><img src="special_files/20.png" class="clay-image img-fluid"></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="callout callout-style-default callout-note callout-titled" title="Examples">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Examples
</div>
</div>
<div class="callout-body-container callout-body">
<div class="sourceClojure">
<div class="sourceCode" id="cb16"><pre class="sourceCode clojure code-with-copy"><code class="sourceCode clojure"><span id="cb16-1"><a href="#cb16-1" aria-hidden="true" tabindex="-1"></a>(special/spherical-bessel-j0 <span class="fl">2.3</span>) <span class="co">;; =&gt; 0.3242196574681393</span></span>
<span id="cb16-2"><a href="#cb16-2" aria-hidden="true" tabindex="-1"></a>(special/spherical-bessel-j1 <span class="fl">2.3</span>) <span class="co">;; =&gt; 0.43065029510781005</span></span>
<span id="cb16-3"><a href="#cb16-3" aria-hidden="true" tabindex="-1"></a>(special/spherical-bessel-j2 <span class="fl">2.3</span>) <span class="co">;; =&gt; 0.23749811875943916</span></span>
<span id="cb16-4"><a href="#cb16-4" aria-hidden="true" tabindex="-1"></a>(special/spherical-bessel-j <span class="fl">3.1</span> <span class="fl">3.2</span>) <span class="co">;; =&gt; 0.1579561007291703</span></span>
<span id="cb16-5"><a href="#cb16-5" aria-hidden="true" tabindex="-1"></a>(special/spherical-bessel-j -<span class="fl">3.1</span> <span class="fl">3.2</span>) <span class="co">;; =&gt; 0.12796785869167607</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
</div>
</div>
<hr>
<p>additional <code>jinc</code> (sombrero) function is defined as:</p>
<p><span class="math display">\[\operatorname{jinc}(x)=\frac{2J_1(\pi x)}{\pi x}\]</span></p>
<div class="clay-image">
<img class="clay-image" src="special_files/21.png">
</div>
<div class="callout callout-style-default callout-note callout-titled" title="Examples">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Examples
</div>
</div>
<div class="callout-body-container callout-body">
<div class="sourceClojure">
<div class="sourceCode" id="cb17"><pre class="sourceCode clojure code-with-copy"><code class="sourceCode clojure"><span id="cb17-1"><a href="#cb17-1" aria-hidden="true" tabindex="-1"></a>(special/jinc <span class="fl">0.0</span>) <span class="co">;; =&gt; 1.0</span></span>
<span id="cb17-2"><a href="#cb17-2" aria-hidden="true" tabindex="-1"></a>(special/jinc -<span class="fl">2.3</span>) <span class="co">;; =&gt; 0.01707103495964295</span></span>
<span id="cb17-3"><a href="#cb17-3" aria-hidden="true" tabindex="-1"></a>(special/jinc <span class="fl">2.3</span>) <span class="co">;; =&gt; 0.01707103495964295</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
</div>
</div>
</section>
<section id="bessel-y-y" class="level3">
<h3 class="anchored" data-anchor-id="bessel-y-y">Bessel Y, y</h3>
<p>Bessel functions of the second kind, <code>bessel-Y</code>, <span class="math inline">\(Y_\alpha(x)\)</span>. <code>bessel-Y0</code> and <code>bessel-Y1</code> are functions of orders <code>0</code> and <code>1</code>. They are defined for positive argument only and any order.</p>
<div class="clay-table">
<div>
<div class="table-responsive">
<table class="table table-hover clay-table" data-quarto-postprocess="true">
<tbody>
<tr class="odd">
<td><img src="special_files/22.png" class="clay-image img-fluid"></td>
<td><img src="special_files/23.png" class="clay-image img-fluid"></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="callout callout-style-default callout-note callout-titled" title="Examples">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Examples
</div>
</div>
<div class="callout-body-container callout-body">
<div class="sourceClojure">
<div class="sourceCode" id="cb18"><pre class="sourceCode clojure code-with-copy"><code class="sourceCode clojure"><span id="cb18-1"><a href="#cb18-1" aria-hidden="true" tabindex="-1"></a>(special/bessel-Y0 <span class="fl">2.3</span>) <span class="co">;; =&gt; 0.5180753962076221</span></span>
<span id="cb18-2"><a href="#cb18-2" aria-hidden="true" tabindex="-1"></a>(special/bessel-Y1 <span class="fl">2.3</span>) <span class="co">;; =&gt; 0.05227731584422471</span></span>
<span id="cb18-3"><a href="#cb18-3" aria-hidden="true" tabindex="-1"></a>(special/bessel-Y <span class="dv">2</span> <span class="fl">2.3</span>) <span class="co">;; =&gt; -0.47261686069090497</span></span>
<span id="cb18-4"><a href="#cb18-4" aria-hidden="true" tabindex="-1"></a>(special/bessel-Y -<span class="fl">2.1</span> <span class="fl">2.3</span>) <span class="co">;; =&gt; -0.36752629274516924</span></span>
<span id="cb18-5"><a href="#cb18-5" aria-hidden="true" tabindex="-1"></a>(special/bessel-Y <span class="dv">3</span> -<span class="dv">1</span>) <span class="co">;; =&gt; ##NaN</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
</div>
</div>
<hr>
<p>Spherical Bessel functions of the second kind <code>spherical-bessel-y</code> <span class="math inline">\(y_\alpha(x)\)</span>, <code>spherical-bessel-y0</code>, <code>spherical-bessel-y1</code> and <code>spherical-bessel-y2</code> are functions of orders <code>0</code>,<code>1</code> and <code>2</code>. Functions are defined for positive argument.</p>
<p><span class="math display">\[y_\alpha(x)=\sqrt{\frac{\pi}{2x}}Y_{\alpha+\frac{1}{2}}(x)\]</span></p>
<div class="clay-table">
<div>
<div class="table-responsive">
<table class="table table-hover clay-table" data-quarto-postprocess="true">
<tbody>
<tr class="odd">
<td><img src="special_files/24.png" class="clay-image img-fluid"></td>
<td><img src="special_files/25.png" class="clay-image img-fluid"></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="callout callout-style-default callout-note callout-titled" title="Examples">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Examples
</div>
</div>
<div class="callout-body-container callout-body">
<div class="sourceClojure">
<div class="sourceCode" id="cb19"><pre class="sourceCode clojure code-with-copy"><code class="sourceCode clojure"><span id="cb19-1"><a href="#cb19-1" aria-hidden="true" tabindex="-1"></a>(special/spherical-bessel-j0 <span class="fl">2.3</span>) <span class="co">;; =&gt; 0.3242196574681393</span></span>
<span id="cb19-2"><a href="#cb19-2" aria-hidden="true" tabindex="-1"></a>(special/spherical-bessel-j1 <span class="fl">2.3</span>) <span class="co">;; =&gt; 0.43065029510781005</span></span>
<span id="cb19-3"><a href="#cb19-3" aria-hidden="true" tabindex="-1"></a>(special/spherical-bessel-j2 <span class="fl">2.3</span>) <span class="co">;; =&gt; 0.23749811875943916</span></span>
<span id="cb19-4"><a href="#cb19-4" aria-hidden="true" tabindex="-1"></a>(special/spherical-bessel-j <span class="fl">3.1</span> <span class="fl">3.2</span>) <span class="co">;; =&gt; 0.1579561007291703</span></span>
<span id="cb19-5"><a href="#cb19-5" aria-hidden="true" tabindex="-1"></a>(special/spherical-bessel-j -<span class="fl">3.1</span> <span class="fl">3.2</span>) <span class="co">;; =&gt; 0.12796785869167607</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
</div>
</div>
</section>
<section id="bessel-i-i" class="level3">
<h3 class="anchored" data-anchor-id="bessel-i-i">Bessel I, i</h3>
<p>Modified Bessel functions of the first kind, <code>bessel-I</code>, <span class="math inline">\(I_\alpha(x)\)</span>, <code>bessel-I0</code> and <code>bessel-I1</code> are functions of orders <code>0</code> and <code>1</code>. An order should be integer for negative arguments.</p>
<div class="clay-table">
<div>
<div class="table-responsive">
<table class="table table-hover clay-table" data-quarto-postprocess="true">
<tbody>
<tr class="odd">
<td><img src="special_files/26.png" class="clay-image img-fluid"></td>
<td><img src="special_files/27.png" class="clay-image img-fluid"></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="callout callout-style-default callout-note callout-titled" title="Examples">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Examples
</div>
</div>
<div class="callout-body-container callout-body">
<div class="sourceClojure">
<div class="sourceCode" id="cb20"><pre class="sourceCode clojure code-with-copy"><code class="sourceCode clojure"><span id="cb20-1"><a href="#cb20-1" aria-hidden="true" tabindex="-1"></a>(special/bessel-I0 <span class="fl">2.3</span>) <span class="co">;; =&gt; 2.8296056006275854</span></span>
<span id="cb20-2"><a href="#cb20-2" aria-hidden="true" tabindex="-1"></a>(special/bessel-I1 <span class="fl">2.3</span>) <span class="co">;; =&gt; 2.097800027517421</span></span>
<span id="cb20-3"><a href="#cb20-3" aria-hidden="true" tabindex="-1"></a>(special/bessel-I <span class="dv">2</span> <span class="fl">2.3</span>) <span class="co">;; =&gt; 1.0054316636559146</span></span>
<span id="cb20-4"><a href="#cb20-4" aria-hidden="true" tabindex="-1"></a>(special/bessel-I -<span class="fl">2.1</span> <span class="fl">2.3</span>) <span class="co">;; =&gt; 0.9505851207098388</span></span>
<span id="cb20-5"><a href="#cb20-5" aria-hidden="true" tabindex="-1"></a>(special/bessel-I -<span class="dv">3</span> -<span class="dv">1</span>) <span class="co">;; =&gt; -0.0221684249243319</span></span>
<span id="cb20-6"><a href="#cb20-6" aria-hidden="true" tabindex="-1"></a>(special/bessel-I -<span class="fl">3.1</span> -<span class="dv">1</span>) <span class="co">;; =&gt; ##NaN</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
</div>
</div>
<hr>
<p>Two modfified spherical Bessel functions of the first kind <code>spherical-bessel-1-i</code> <span class="math inline">\(i_\alpha^{(1)}(x)\)</span> and <code>spherical-bessel-2-i</code> <span class="math inline">\(i_\alpha^{(2)}(x)\)</span>. <code>spherical-bessel-1-i0</code>, <code>spherical-bessel-1-i1</code>, <code>spherical-bessel-1-i2</code>, <code>spherical-bessel-2-i0</code>, <code>spherical-bessel-2-i1</code> and <code>spherical-bessel-2-i2</code> are functions of orders <code>0</code>,<code>1</code> and <code>2</code>. Functions are defined for positive argument.</p>
<p><span class="math display">\[i_\alpha^{(1)}(x)=\sqrt{\frac{\pi}{2x}}I_{\alpha+\frac{1}{2}}(x)\]</span> <span class="math display">\[i_\alpha^{(2)}(x)=\sqrt{\frac{\pi}{2x}}I_{-\alpha-\frac{1}{2}}(x)\]</span></p>
<div class="clay-table">
<div>
<div class="table-responsive">
<table class="table table-hover clay-table" data-quarto-postprocess="true">
<tbody>
<tr class="odd">
<td><img src="special_files/28.png" class="clay-image img-fluid"></td>
<td><img src="special_files/29.png" class="clay-image img-fluid"></td>
</tr>
<tr class="even">
<td><img src="special_files/30.png" class="clay-image img-fluid"></td>
<td><img src="special_files/31.png" class="clay-image img-fluid"></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="callout callout-style-default callout-note callout-titled" title="Examples">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Examples
</div>
</div>
<div class="callout-body-container callout-body">
<p><span class="math inline">\(i_\alpha^{(1)}\)</span></p>
<div class="sourceClojure">
<div class="sourceCode" id="cb21"><pre class="sourceCode clojure code-with-copy"><code class="sourceCode clojure"><span id="cb21-1"><a href="#cb21-1" aria-hidden="true" tabindex="-1"></a>(special/spherical-bessel<span class="dv">-1</span>-i0 <span class="fl">2.3</span>) <span class="co">;; =&gt; 2.1465051328460687</span></span>
<span id="cb21-2"><a href="#cb21-2" aria-hidden="true" tabindex="-1"></a>(special/spherical-bessel<span class="dv">-1</span>-i1 <span class="fl">2.3</span>) <span class="co">;; =&gt; 1.256832833227258</span></span>
<span id="cb21-3"><a href="#cb21-3" aria-hidden="true" tabindex="-1"></a>(special/spherical-bessel<span class="dv">-1</span>-i2 <span class="fl">2.3</span>) <span class="co">;; =&gt; 0.5071579590713844</span></span>
<span id="cb21-4"><a href="#cb21-4" aria-hidden="true" tabindex="-1"></a>(special/spherical-bessel<span class="dv">-1</span>-i <span class="fl">3.1</span> <span class="fl">3.2</span>) <span class="co">;; =&gt; 0.48382455936204793</span></span>
<span id="cb21-5"><a href="#cb21-5" aria-hidden="true" tabindex="-1"></a>(special/spherical-bessel<span class="dv">-1</span>-i -<span class="fl">3.1</span> <span class="fl">3.2</span>) <span class="co">;; =&gt; 1.271418391309527</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
<p><span class="math inline">\(i_\alpha^{(2)}\)</span></p>
<div class="sourceClojure">
<div class="sourceCode" id="cb22"><pre class="sourceCode clojure code-with-copy"><code class="sourceCode clojure"><span id="cb22-1"><a href="#cb22-1" aria-hidden="true" tabindex="-1"></a>(special/spherical-bessel<span class="dv">-2</span>-i0 <span class="fl">2.3</span>) <span class="co">;; =&gt; 2.1900959344646793</span></span>
<span id="cb22-2"><a href="#cb22-2" aria-hidden="true" tabindex="-1"></a>(special/spherical-bessel<span class="dv">-2</span>-i1 <span class="fl">2.3</span>) <span class="co">;; =&gt; 1.1942895091657733</span></span>
<span id="cb22-3"><a href="#cb22-3" aria-hidden="true" tabindex="-1"></a>(special/spherical-bessel<span class="dv">-2</span>-i2 <span class="fl">2.3</span>) <span class="co">;; =&gt; 0.6323270094658442</span></span>
<span id="cb22-4"><a href="#cb22-4" aria-hidden="true" tabindex="-1"></a>(special/spherical-bessel<span class="dv">-2</span>-i <span class="fl">3.1</span> <span class="fl">3.2</span>) <span class="co">;; =&gt; 0.42032145323101916</span></span>
<span id="cb22-5"><a href="#cb22-5" aria-hidden="true" tabindex="-1"></a>(special/spherical-bessel<span class="dv">-2</span>-i -<span class="fl">3.1</span> <span class="fl">3.2</span>) <span class="co">;; =&gt; 1.2425414548936577</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
</div>
</div>
</section>
<section id="bessel-k-k" class="level3">
<h3 class="anchored" data-anchor-id="bessel-k-k">Bessel K, k</h3>
<p>Modified Bessel functions of the second kind, <code>bessel-K</code>, <span class="math inline">\(K_\alpha(x)\)</span>, <code>bessel-K0</code> and <code>bessel-K1</code> are functions of orders <code>0</code> and <code>1</code>. They are defined for positive argument only and any order.</p>
<div class="clay-table">
<div>
<div class="table-responsive">
<table class="table table-hover clay-table" data-quarto-postprocess="true">
<tbody>
<tr class="odd">
<td><img src="special_files/32.png" class="clay-image img-fluid"></td>
<td><img src="special_files/33.png" class="clay-image img-fluid"></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="callout callout-style-default callout-note callout-titled" title="Examples">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Examples
</div>
</div>
<div class="callout-body-container callout-body">
<div class="sourceClojure">
<div class="sourceCode" id="cb23"><pre class="sourceCode clojure code-with-copy"><code class="sourceCode clojure"><span id="cb23-1"><a href="#cb23-1" aria-hidden="true" tabindex="-1"></a>(special/bessel-K0 <span class="fl">2.3</span>) <span class="co">;; =&gt; 0.07913993300209364</span></span>
<span id="cb23-2"><a href="#cb23-2" aria-hidden="true" tabindex="-1"></a>(special/bessel-K1 <span class="fl">2.3</span>) <span class="co">;; =&gt; 0.09498244384536267</span></span>
<span id="cb23-3"><a href="#cb23-3" aria-hidden="true" tabindex="-1"></a>(special/bessel-K <span class="dv">2</span> <span class="fl">2.3</span>) <span class="co">;; =&gt; 0.1617333624328438</span></span>
<span id="cb23-4"><a href="#cb23-4" aria-hidden="true" tabindex="-1"></a>(special/bessel-K -<span class="fl">2.1</span> <span class="fl">2.3</span>) <span class="co">;; =&gt; 0.17365527243516982</span></span>
<span id="cb23-5"><a href="#cb23-5" aria-hidden="true" tabindex="-1"></a>(special/bessel-K <span class="dv">3</span> -<span class="dv">1</span>) <span class="co">;; =&gt; ##NaN</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
</div>
</div>
<hr>
<p>Additionally <code>bessel-K-half-odd</code> function is optimized version for order of the half of odd integer, ie <code>1/2</code>, <code>3/2</code>, <code>5/2</code> and so on. First argument is an odd numerator.</p>
<div class="clay-image">
<img class="clay-image" src="special_files/34.png">
</div>
<div class="callout callout-style-default callout-note callout-titled" title="Examples">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Examples
</div>
</div>
<div class="callout-body-container callout-body">
<div class="sourceClojure">
<div class="sourceCode" id="cb24"><pre class="sourceCode clojure code-with-copy"><code class="sourceCode clojure"><span id="cb24-1"><a href="#cb24-1" aria-hidden="true" tabindex="-1"></a>[(special/bessel-K-half-odd <span class="dv">1</span> <span class="fl">2.3</span>) (special/bessel-K <span class="fl">0.5</span> <span class="fl">2.3</span>)] <span class="co">;; =&gt; [0.0828549981836159 0.0828549981836159]</span></span>
<span id="cb24-2"><a href="#cb24-2" aria-hidden="true" tabindex="-1"></a>[(special/bessel-K-half-odd <span class="dv">3</span> <span class="fl">2.3</span>) (special/bessel-K <span class="fl">1.5</span> <span class="fl">2.3</span>)] <span class="co">;; =&gt; [0.11887891043736196 0.11887891043736196]</span></span>
<span id="cb24-3"><a href="#cb24-3" aria-hidden="true" tabindex="-1"></a>[(special/bessel-K-half-odd <span class="dv">5</span> <span class="fl">2.3</span>) (special/bessel-K <span class="fl">2.5</span> <span class="fl">2.3</span>)] <span class="co">;; =&gt; [0.23791444658017497 0.23791444658017497]</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
</div>
</div>
<hr>
<p>Modified spherical Bessel functions of the second kind <code>spherical-bessel-k</code> <span class="math inline">\(k_\alpha(x)\)</span>, <code>spherical-bessel-k0</code>, <code>spherical-bessel-k1</code> and <code>spherical-bessel-k2</code> are functions of orders <code>0</code>,<code>1</code> and <code>2</code>. Functions are defined for positive argument.</p>
<p><span class="math display">\[k_\alpha(x)=\sqrt{\frac{\pi}{2x}}K_{\alpha+\frac{1}{2}}(x)\]</span></p>
<div class="clay-table">
<div>
<div class="table-responsive">
<table class="table table-hover clay-table" data-quarto-postprocess="true">
<tbody>
<tr class="odd">
<td><img src="special_files/35.png" class="clay-image img-fluid"></td>
<td><img src="special_files/36.png" class="clay-image img-fluid"></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="callout callout-style-default callout-note callout-titled" title="Examples">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Examples
</div>
</div>
<div class="callout-body-container callout-body">
<div class="sourceClojure">
<div class="sourceCode" id="cb25"><pre class="sourceCode clojure code-with-copy"><code class="sourceCode clojure"><span id="cb25-1"><a href="#cb25-1" aria-hidden="true" tabindex="-1"></a>(special/spherical-bessel-k0 <span class="fl">2.3</span>) <span class="co">;; =&gt; 0.06847227106455815</span></span>
<span id="cb25-2"><a href="#cb25-2" aria-hidden="true" tabindex="-1"></a>(special/spherical-bessel-k1 <span class="fl">2.3</span>) <span class="co">;; =&gt; 0.09824282370132256</span></span>
<span id="cb25-3"><a href="#cb25-3" aria-hidden="true" tabindex="-1"></a>(special/spherical-bessel-k2 <span class="fl">2.3</span>) <span class="co">;; =&gt; 0.19661508458802238</span></span>
<span id="cb25-4"><a href="#cb25-4" aria-hidden="true" tabindex="-1"></a>(special/spherical-bessel-k <span class="fl">3.1</span> <span class="fl">3.2</span>) <span class="co">;; =&gt; 0.10488382566292166</span></span>
<span id="cb25-5"><a href="#cb25-5" aria-hidden="true" tabindex="-1"></a>(special/spherical-bessel-k -<span class="fl">3.1</span> <span class="fl">3.2</span>) <span class="co">;; =&gt; 0.047694101111715716</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
</div>
</div>
</section>
</section>
<section id="erf" class="level2">
<h2 class="anchored" data-anchor-id="erf">Erf</h2>
<div class="callout callout-style-default callout-tip callout-titled" title="Defined functions">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Defined functions
</div>
</div>
<div class="callout-body-container callout-body">
<ul>
<li><code>erf</code>, <code>erfc</code></li>
<li><code>inv-erf</code>, <code>inv-erfc</code></li>
</ul>
</div>
</div>
<p>Error functions</p>
<p><span class="math display">\[\operatorname{erf}(x)=\frac{2}{\sqrt\pi}\int_0^x e^{-t^2}\,dt\]</span> <span class="math display">\[\operatorname{erfc}(x)=1-\operatorname{erf}(x)\]</span></p>
<div class="clay-table">
<div>
<div class="table-responsive">
<table class="table table-hover clay-table" data-quarto-postprocess="true">
<tbody>
<tr class="odd">
<td><img src="special_files/37.png" class="clay-image img-fluid"></td>
<td><img src="special_files/38.png" class="clay-image img-fluid"></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<p>When two arguments are passed, difference between erf of two values is calculated <span class="math inline">\(\operatorname{erf}(x_2)-\operatorname{erf}(x_1)\)</span></p>
<div class="callout callout-style-default callout-note callout-titled" title="Examples">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Examples
</div>
</div>
<div class="callout-body-container callout-body">
<div class="sourceClojure">
<div class="sourceCode" id="cb26"><pre class="sourceCode clojure code-with-copy"><code class="sourceCode clojure"><span id="cb26-1"><a href="#cb26-1" aria-hidden="true" tabindex="-1"></a>(special/erf <span class="fl">0.4</span>) <span class="co">;; =&gt; 0.4283923550466685</span></span>
<span id="cb26-2"><a href="#cb26-2" aria-hidden="true" tabindex="-1"></a>(special/erfc <span class="fl">0.4</span>) <span class="co">;; =&gt; 0.5716076449533315</span></span>
<span id="cb26-3"><a href="#cb26-3" aria-hidden="true" tabindex="-1"></a>[(special/erf <span class="fl">0.5</span> <span class="fl">0.4</span>) (<span class="kw">-</span> (special/erf <span class="fl">0.4</span>) (special/erf <span class="fl">0.5</span>))] <span class="co">;; =&gt; [-0.09210752276637812 -0.09210752276637812]</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
</div>
</div>
<hr>
<p>Inverse of error functions.</p>
<ul>
<li><code>inv-erf</code> - inverse of <code>erf</code> defined on <span class="math inline">\((-1,1)\)</span></li>
<li><code>inv-erfc</code>- inverse of <code>erfc</code> defined on <span class="math inline">\((0,2)\)</span></li>
</ul>
<div class="clay-table">
<div>
<div class="table-responsive">
<table class="table table-hover clay-table" data-quarto-postprocess="true">
<tbody>
<tr class="odd">
<td><img src="special_files/39.png" class="clay-image img-fluid"></td>
<td><img src="special_files/40.png" class="clay-image img-fluid"></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="callout callout-style-default callout-note callout-titled" title="Examples">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Examples
</div>
</div>
<div class="callout-body-container callout-body">
<div class="sourceClojure">
<div class="sourceCode" id="cb27"><pre class="sourceCode clojure code-with-copy"><code class="sourceCode clojure"><span id="cb27-1"><a href="#cb27-1" aria-hidden="true" tabindex="-1"></a>(special/inv-erf <span class="fl">0.42839235504666856</span>) <span class="co">;; =&gt; 0.4</span></span>
<span id="cb27-2"><a href="#cb27-2" aria-hidden="true" tabindex="-1"></a>(special/inv-erfc (<span class="kw">-</span> <span class="dv">1</span> <span class="fl">0.42839235504666856</span>)) <span class="co">;; =&gt; 0.4000000000000001</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
</div>
</div>
</section>
<section id="airy" class="level2">
<h2 class="anchored" data-anchor-id="airy">Airy</h2>
<p>Airy functions and derivatives</p>
<div class="callout callout-style-default callout-tip callout-titled" title="Defined functions">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Defined functions
</div>
</div>
<div class="callout-body-container callout-body">
<ul>
<li><code>airy-Ai</code>, <code>airy-Bi</code></li>
<li><code>airy-Ai'</code> <code>airy-Bi'</code></li>
</ul>
</div>
</div>
<div class="clay-table">
<div>
<div class="table-responsive">
<table class="table table-hover clay-table" data-quarto-postprocess="true">
<tbody>
<tr class="odd">
<td><img src="special_files/41.png" class="clay-image img-fluid"></td>
<td><img src="special_files/42.png" class="clay-image img-fluid"></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="callout callout-style-default callout-note callout-titled" title="Examples">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Examples
</div>
</div>
<div class="callout-body-container callout-body">
<div class="sourceClojure">
<div class="sourceCode" id="cb28"><pre class="sourceCode clojure code-with-copy"><code class="sourceCode clojure"><span id="cb28-1"><a href="#cb28-1" aria-hidden="true" tabindex="-1"></a>(special/airy-Ai <span class="fl">2.3</span>) <span class="co">;; =&gt; 0.02183199318062265</span></span>
<span id="cb28-2"><a href="#cb28-2" aria-hidden="true" tabindex="-1"></a>(special/airy-Bi <span class="fl">2.3</span>) <span class="co">;; =&gt; 4.885061581835644</span></span>
<span id="cb28-3"><a href="#cb28-3" aria-hidden="true" tabindex="-1"></a>(special/airy-Ai' <span class="fl">2.3</span>) <span class="co">;; =&gt; -0.03517312272081809</span></span>
<span id="cb28-4"><a href="#cb28-4" aria-hidden="true" tabindex="-1"></a>(special/airy-Bi' <span class="fl">2.3</span>) <span class="co">;; =&gt; 6.709740812723825</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
</div>
</div>
</section>
<section id="integrals" class="level2">
<h2 class="anchored" data-anchor-id="integrals">Integrals</h2>
<p>Trigonometric, exponential and logarithmic integrals</p>
<div class="callout callout-style-default callout-tip callout-titled" title="Defined functions">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Defined functions
</div>
</div>
<div class="callout-body-container callout-body">
<ul>
<li><code>Si</code>, <code>si</code>, <code>Ci</code>, <code>Cin</code></li>
<li><code>E0</code>, <code>E1</code>, <code>Ei</code>, <code>Ein</code>, <code>En</code></li>
<li><code>li</code>, <code>Li</code> (offset)</li>
</ul>
</div>
</div>
<section id="trigonometric" class="level3">
<h3 class="anchored" data-anchor-id="trigonometric">Trigonometric</h3>
<p>Sine and cosine integrals</p>
<p><span class="math display">\[\operatorname{Si}(x)=\int_0^x\frac{\sin t}{t}\, dt\]</span> <span class="math display">\[\operatorname{si}(x)=-\int_x^\infty\frac{\sin t}{t}\, dt = \operatorname{Si}(x)-\frac{\pi}{2}\]</span> <span class="math display">\[\operatorname{Ci}(x)=-\int_x^\infty\frac{\cos t}{t}\, dt\]</span> <span class="math display">\[\operatorname{Cin}(x)=\int_0^x\frac{1-\cos t}{t}\, dt = \gamma + \ln x- \operatorname{Ci}(x)\]</span></p>
<div class="clay-table">
<div>
<div class="table-responsive">
<table class="table table-hover clay-table" data-quarto-postprocess="true">
<tbody>
<tr class="odd">
<td><img src="special_files/43.png" class="clay-image img-fluid"></td>
<td><img src="special_files/44.png" class="clay-image img-fluid"></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="callout callout-style-default callout-note callout-titled" title="Examples">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Examples
</div>
</div>
<div class="callout-body-container callout-body">
<div class="sourceClojure">
<div class="sourceCode" id="cb29"><pre class="sourceCode clojure code-with-copy"><code class="sourceCode clojure"><span id="cb29-1"><a href="#cb29-1" aria-hidden="true" tabindex="-1"></a>(special/Si <span class="fl">0.5</span>) <span class="co">;; =&gt; 0.49310741804306674</span></span>
<span id="cb29-2"><a href="#cb29-2" aria-hidden="true" tabindex="-1"></a>(special/si <span class="fl">0.5</span>) <span class="co">;; =&gt; -1.0776889087518298</span></span>
<span id="cb29-3"><a href="#cb29-3" aria-hidden="true" tabindex="-1"></a>(special/Ci <span class="fl">0.5</span>) <span class="co">;; =&gt; -0.17778407880661298</span></span>
<span id="cb29-4"><a href="#cb29-4" aria-hidden="true" tabindex="-1"></a>(special/Cin <span class="fl">0.5</span>) <span class="co">;; =&gt; 0.06185256314820056</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
</div>
</div>
</section>
<section id="exponential" class="level3">
<h3 class="anchored" data-anchor-id="exponential">Exponential</h3>
<p>Exponential integrals</p>
<p><span class="math display">\[E_0(x)=\frac{e^{-x}}{x}\]</span> <span class="math display">\[E_1(x)=\int_x^\infty\frac{e^{-t}}{t}\,dt\]</span> <span class="math display">\[E_i(x)=-\int_{-x}^\infty\frac{e^{-t}}{t}\,dt\]</span> <span class="math display">\[E_{in}(x)=\int_0^x\frac{1-e^{-t}}{t}\,dt\]</span> <span class="math display">\[E_n(x)=\int_1^\infty\frac{e^{-xt}}{t^n}\,dt\]</span></p>
<div class="clay-table">
<div>
<div class="table-responsive">
<table class="table table-hover clay-table" data-quarto-postprocess="true">
<tbody>
<tr class="odd">
<td><img src="special_files/45.png" class="clay-image img-fluid"></td>
<td><img src="special_files/46.png" class="clay-image img-fluid"></td>
</tr>
<tr class="even">
<td><img src="special_files/47.png" class="clay-image img-fluid"></td>
<td><img src="special_files/48.png" class="clay-image img-fluid"></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="callout callout-style-default callout-note callout-titled" title="Examples">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Examples
</div>
</div>
<div class="callout-body-container callout-body">
<div class="sourceClojure">
<div class="sourceCode" id="cb30"><pre class="sourceCode clojure code-with-copy"><code class="sourceCode clojure"><span id="cb30-1"><a href="#cb30-1" aria-hidden="true" tabindex="-1"></a>(special/E0 <span class="fl">0.6</span>) <span class="co">;; =&gt; 0.9146860601567108</span></span>
<span id="cb30-2"><a href="#cb30-2" aria-hidden="true" tabindex="-1"></a>(special/E1 <span class="fl">0.6</span>) <span class="co">;; =&gt; 0.4543795031894021</span></span>
<span id="cb30-3"><a href="#cb30-3" aria-hidden="true" tabindex="-1"></a>(special/Ei <span class="fl">0.6</span>) <span class="co">;; =&gt; 0.7699269875786519</span></span>
<span id="cb30-4"><a href="#cb30-4" aria-hidden="true" tabindex="-1"></a>(special/Ein <span class="fl">0.6</span>) <span class="co">;; =&gt; 0.5207695443249443</span></span>
<span id="cb30-5"><a href="#cb30-5" aria-hidden="true" tabindex="-1"></a>(special/En <span class="dv">2</span> <span class="fl">0.6</span>) <span class="co">;; =&gt; 0.2761839341803851</span></span>
<span id="cb30-6"><a href="#cb30-6" aria-hidden="true" tabindex="-1"></a>(special/En -<span class="dv">2</span> <span class="fl">0.6</span>) <span class="co">;; =&gt; 9.04522881710525</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
</div>
</div>
</section>
<section id="logarithmic" class="level3">
<h3 class="anchored" data-anchor-id="logarithmic">Logarithmic</h3>
<p>Logarithmic integrals</p>
<p><span class="math display">\[\operatorname{li}(x)=\int_0^x\frac{dt}{\ln t}\]</span> <span class="math display">\[\operatorname{Li}(x)=\int_2^x\frac{dt}{\ln t}=\operatorname{li}(x)-\operatorname{li}(2)\]</span></p>
<div class="clay-image">
<img class="clay-image" src="special_files/49.png">
</div>
<div class="callout callout-style-default callout-note callout-titled" title="Examples">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Examples
</div>
</div>
<div class="callout-body-container callout-body">
<div class="sourceClojure">
<div class="sourceCode" id="cb31"><pre class="sourceCode clojure code-with-copy"><code class="sourceCode clojure"><span id="cb31-1"><a href="#cb31-1" aria-hidden="true" tabindex="-1"></a>(special/li <span class="fl">0.5</span>) <span class="co">;; =&gt; -0.378671043061088</span></span>
<span id="cb31-2"><a href="#cb31-2" aria-hidden="true" tabindex="-1"></a>(special/Li <span class="fl">0.5</span>) <span class="co">;; =&gt; -1.423834823178581</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
</div>
</div>
</section>
</section>
<section id="zeta" class="level2">
<h2 class="anchored" data-anchor-id="zeta">Zeta</h2>
<p>Zeta function and related</p>
<div class="callout callout-style-default callout-tip callout-titled" title="Defined functions">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Defined functions
</div>
</div>
<div class="callout-body-container callout-body">
<ul>
<li><code>zeta</code> - Riemann and Hurwitz zeta</li>
<li><code>xi</code> - Riemann (Landau) xi</li>
<li><code>eta</code> - Dirichlet eta</li>
<li><code>dirichlet-beta</code> - Dirichlet beta</li>
</ul>
</div>
</div>
<section id="riemann-zeta" class="level3">
<h3 class="anchored" data-anchor-id="riemann-zeta">Riemann zeta</h3>
<p><span class="math display">\[\zeta(s)=\sum_{n=1}^\infty\frac{1}{n^s}\]</span></p>
<div class="clay-image">
<img class="clay-image" src="special_files/50.png">
</div>
<div class="callout callout-style-default callout-note callout-titled" title="Examples">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Examples
</div>
</div>
<div class="callout-body-container callout-body">
<div class="sourceClojure">
<div class="sourceCode" id="cb32"><pre class="sourceCode clojure code-with-copy"><code class="sourceCode clojure"><span id="cb32-1"><a href="#cb32-1" aria-hidden="true" tabindex="-1"></a>(special/zeta <span class="fl">0.0</span>) <span class="co">;; =&gt; -0.5</span></span>
<span id="cb32-2"><a href="#cb32-2" aria-hidden="true" tabindex="-1"></a>(special/zeta <span class="fl">2.2</span>) <span class="co">;; =&gt; 1.4905432565068941</span></span>
<span id="cb32-3"><a href="#cb32-3" aria-hidden="true" tabindex="-1"></a>(special/zeta -<span class="fl">2.2</span>) <span class="co">;; =&gt; 0.0048792123593036025</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
</div>
</div>
</section>
<section id="hurwitz-zeta" class="level3">
<h3 class="anchored" data-anchor-id="hurwitz-zeta">Hurwitz zeta</h3>
<p><span class="math display">\[\zeta(s,z)=\sum_{n=1}^\infty\frac{1}{(n+z)^s}\]</span></p>
<div class="clay-table">
<div>
<div class="table-responsive">
<table class="table table-hover clay-table" data-quarto-postprocess="true">
<tbody>
<tr class="odd">
<td><img src="special_files/51.png" class="clay-image img-fluid"></td>
<td><img src="special_files/52.png" class="clay-image img-fluid"></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="callout callout-style-default callout-note callout-titled" title="Examples">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Examples
</div>
</div>
<div class="callout-body-container callout-body">
<div class="sourceClojure">
<div class="sourceCode" id="cb33"><pre class="sourceCode clojure code-with-copy"><code class="sourceCode clojure"><span id="cb33-1"><a href="#cb33-1" aria-hidden="true" tabindex="-1"></a>(special/zeta <span class="fl">0.0</span> <span class="dv">3</span>) <span class="co">;; =&gt; -2.5</span></span>
<span id="cb33-2"><a href="#cb33-2" aria-hidden="true" tabindex="-1"></a>(special/zeta <span class="fl">2.2</span> <span class="dv">3</span>) <span class="co">;; =&gt; 0.27290561568286237</span></span>
<span id="cb33-3"><a href="#cb33-3" aria-hidden="true" tabindex="-1"></a>(special/zeta -<span class="fl">2.2</span> <span class="dv">3</span>) <span class="co">;; =&gt; -5.589914207628901</span></span>
<span id="cb33-4"><a href="#cb33-4" aria-hidden="true" tabindex="-1"></a>(special/zeta <span class="fl">2.2</span> -<span class="dv">3</span>) <span class="co">;; =&gt; 2.7973744041931727</span></span>
<span id="cb33-5"><a href="#cb33-5" aria-hidden="true" tabindex="-1"></a>(special/zeta -<span class="fl">2.2</span> -<span class="dv">3</span>) <span class="co">;; =&gt; 16.811251088887037</span></span>
<span id="cb33-6"><a href="#cb33-6" aria-hidden="true" tabindex="-1"></a>(special/zeta <span class="fl">0.0</span> -<span class="dv">3</span>) <span class="co">;; =&gt; 2.5</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
</div>
</div>
</section>
<section id="xi" class="level3">
<h3 class="anchored" data-anchor-id="xi">xi</h3>
<p>Landau’s Xi function, symmetrical along <span class="math inline">\(x=0.5\)</span></p>
<p><span class="math display">\[\xi(s)=\frac{1}{2}s(s-1)\pi^{-\frac{s}{2}}\Gamma\left(\frac{s}{2}\right)\zeta(s)\]</span> <span class="math display">\[\xi(s)=\xi(1-s)\]</span></p>
<div class="clay-image">
<img class="clay-image" src="special_files/53.png">
</div>
<div class="callout callout-style-default callout-note callout-titled" title="Examples">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Examples
</div>
</div>
<div class="callout-body-container callout-body">
<div class="sourceClojure">
<div class="sourceCode" id="cb34"><pre class="sourceCode clojure code-with-copy"><code class="sourceCode clojure"><span id="cb34-1"><a href="#cb34-1" aria-hidden="true" tabindex="-1"></a>(special/xi <span class="fl">0.0</span>) <span class="co">;; =&gt; 0.5</span></span>
<span id="cb34-2"><a href="#cb34-2" aria-hidden="true" tabindex="-1"></a>(special/xi <span class="fl">3.5</span>) <span class="co">;; =&gt; 0.6111280074951515</span></span>
<span id="cb34-3"><a href="#cb34-3" aria-hidden="true" tabindex="-1"></a>(special/xi (<span class="kw">-</span> <span class="fl">1.0</span> <span class="fl">3.5</span>)) <span class="co">;; =&gt; 0.6111280074951515</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
</div>
</div>
</section>
<section id="eta" class="level3">
<h3 class="anchored" data-anchor-id="eta">eta</h3>
<p>Dirichlet eta function</p>
<p><span class="math display">\[\eta(s)=\sum_{n=1}^\infty\frac{(-1)^{n-1}}{n^s}=(1-2^{1-s})\zeta(s)\]</span></p>
<div class="clay-image">
<img class="clay-image" src="special_files/54.png">
</div>
<div class="callout callout-style-default callout-note callout-titled" title="Examples">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Examples
</div>
</div>
<div class="callout-body-container callout-body">
<div class="sourceClojure">
<div class="sourceCode" id="cb35"><pre class="sourceCode clojure code-with-copy"><code class="sourceCode clojure"><span id="cb35-1"><a href="#cb35-1" aria-hidden="true" tabindex="-1"></a>(special/eta <span class="fl">0.0</span>) <span class="co">;; =&gt; 0.5</span></span>
<span id="cb35-2"><a href="#cb35-2" aria-hidden="true" tabindex="-1"></a>(special/eta <span class="fl">3.5</span>) <span class="co">;; =&gt; 0.927553577773949</span></span>
<span id="cb35-3"><a href="#cb35-3" aria-hidden="true" tabindex="-1"></a>(special/eta -<span class="fl">3.5</span>) <span class="co">;; =&gt; -0.09604760404512332</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
</div>
</div>
</section>
<section id="beta-1" class="level3">
<h3 class="anchored" data-anchor-id="beta-1">beta</h3>
<p>Dirichlet (Catalan) beta function</p>
<p><span class="math display">\[\beta(s)=\sum_{n=0}^\infty\frac{(-1)^n}{(2n+1)^s}\]</span></p>
<div class="clay-image">
<img class="clay-image" src="special_files/55.png">
</div>
<div class="callout callout-style-default callout-note callout-titled" title="Examples">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Examples
</div>
</div>
<div class="callout-body-container callout-body">
<div class="sourceClojure">
<div class="sourceCode" id="cb36"><pre class="sourceCode clojure code-with-copy"><code class="sourceCode clojure"><span id="cb36-1"><a href="#cb36-1" aria-hidden="true" tabindex="-1"></a>(special/dirichlet-beta <span class="fl">0.0</span>) <span class="co">;; =&gt; 0.5</span></span>
<span id="cb36-2"><a href="#cb36-2" aria-hidden="true" tabindex="-1"></a>(special/dirichlet-beta <span class="fl">3.5</span>) <span class="co">;; =&gt; 0.9814025112714404</span></span>
<span id="cb36-3"><a href="#cb36-3" aria-hidden="true" tabindex="-1"></a>(special/dirichlet-beta -<span class="fl">3.5</span>) <span class="co">;; =&gt; 1.0708860161983005</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
</div>
</div>
</section>
</section>
<section id="hypergeometric" class="level2">
<h2 class="anchored" data-anchor-id="hypergeometric">Hypergeometric</h2>
<p>Selection of hypergeometric functions <span class="math inline">\({}_pF_q\)</span></p>
<p><span class="math display">\[{{}_{p}F_{q}}\left({a_{1},\dots,a_{p}\atop b_{1},\dots,b_{q}};x\right)=\sum_{k=0}^{\infty}\frac{{\left(a_{1}\right)_{k}}\cdots{\left(a_{p}\right)_{k}}}{{\left(b_{1}\right)_{k}}\cdots{\left(b_{q}\right)_{k}}}\frac{x^{k}}{k!}.\]</span></p>
<p>where <span class="math inline">\((a_p)_k\)</span> and <span class="math inline">\((b_q)_k\)</span> are k<sup>th</sup> rising factorials</p>
<div class="callout callout-style-default callout-tip callout-titled" title="Defined functions">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Defined functions
</div>
</div>
<div class="callout-body-container callout-body">
<ul>
<li><code>hypergeometric-pFq</code>, <code>hypergeometric-pFq-ratio</code></li>
<li><code>hypergeometric-0F0</code>, <code>hypergeometric-0F1</code>, <code>hypergeometric-0F2</code></li>
<li><code>hypergeometric-1F0</code>, <code>hypergeometric-1F1</code></li>
<li><code>hypergeometric-2F0</code>, <code>hypergeometric-2F1</code></li>
<li><code>kummers-M</code>, <code>tricomis-U</code></li>
<li><code>whittaker-M</code>, <code>whittaker-W</code></li>
</ul>
</div>
</div>
<p>Functions are implemented using various recursive formulas, Maclaurin series and Weniger acceleration.</p>
<section id="pfq-generalized" class="level3">
<h3 class="anchored" data-anchor-id="pfq-generalized"><sub>p</sub>F<sub>q</sub>, generalized</h3>
<p>Two implementations of general <span class="math inline">\({}_pF_q\)</span> hypergeometric functions using Maclaurin series. One implementation operates on doubles (<code>hypergeometric-pFq</code>), second on Clojure <code>ratio</code> type which is accurate but slow (<code>hypergeometric-pFq-ratio</code>).</p>
<div class="callout callout-style-default callout-note callout-titled" title="Examples">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Examples
</div>
</div>
<div class="callout-body-container callout-body">
<div class="sourceClojure">
<div class="sourceCode" id="cb37"><pre class="sourceCode clojure code-with-copy"><code class="sourceCode clojure"><span id="cb37-1"><a href="#cb37-1" aria-hidden="true" tabindex="-1"></a>(special/hypergeometric<span class="dv">-2</span>F0 <span class="fl">0.1</span> <span class="fl">0.1</span> <span class="fl">0.01</span>) <span class="co">;; =&gt; 1.0001006141146784</span></span>
<span id="cb37-2"><a href="#cb37-2" aria-hidden="true" tabindex="-1"></a>(special/hypergeometric-pFq [<span class="fl">0.1</span> <span class="fl">0.1</span>] [] <span class="fl">0.01</span>) <span class="co">;; =&gt; 1.0001006141146789</span></span>
<span id="cb37-3"><a href="#cb37-3" aria-hidden="true" tabindex="-1"></a>(special/hypergeometric-pFq-ratio [<span class="fl">0.1</span> <span class="fl">0.1</span>] [] <span class="fl">0.01</span>) <span class="co">;; =&gt; 1.000100614114679</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
</div>
</div>
<p>Both functions accept optional <code>max-iters</code> parameter to control number of iterations.</p>
<p>Every implementation but ratio is unstable. Take a look at the example of <span class="math inline">\({}_1F_1(-50;3;19.5)\)</span>, only ratio version gives a valid result.</p>
<div class="callout callout-style-default callout-note callout-titled" title="Examples">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Examples
</div>
</div>
<div class="callout-body-container callout-body">
<div class="sourceClojure">
<div class="sourceCode" id="cb38"><pre class="sourceCode clojure code-with-copy"><code class="sourceCode clojure"><span id="cb38-1"><a href="#cb38-1" aria-hidden="true" tabindex="-1"></a>(special/hypergeometric<span class="dv">-1</span>F1 -<span class="dv">50</span> <span class="dv">3</span> <span class="fl">19.5</span>) <span class="co">;; =&gt; 864.8061702264724</span></span>
<span id="cb38-2"><a href="#cb38-2" aria-hidden="true" tabindex="-1"></a>(special/hypergeometric-pFq [-<span class="dv">50</span>] [<span class="dv">3</span>] <span class="fl">19.5</span>) <span class="co">;; =&gt; -1072.5532046613325</span></span>
<span id="cb38-3"><a href="#cb38-3" aria-hidden="true" tabindex="-1"></a>(special/hypergeometric-pFq-ratio [-<span class="dv">50</span>] [<span class="dv">3</span>] <span class="fl">19.5</span>) <span class="co">;; =&gt; -1.195066852171838</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
</div>
</div>
<p>Following plot shows stable (but slow) implementation <code>hypergeometric-pFq-ratio</code> vs unstable (but fast) <code>hypergeometric-1F1</code> and Maclaurin seriers <code>hypergeometric-pFq</code>.</p>
<div class="clay-image">
<img class="clay-image" src="special_files/56.png">
</div>
</section>
<section id="f0-exp" class="level3">
<h3 class="anchored" data-anchor-id="f0-exp"><sub>0</sub>F<sub>0</sub>, exp</h3>
<p><span class="math inline">\({}_0F_0\)</span> is simply exponential function.</p>
<p><span class="math display">\[{}_0F_0(;;x)=\sum_{k=0}^\infty\frac{x^k}{k!}=e^x\]</span></p>
<div class="callout callout-style-default callout-note callout-titled" title="Examples">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Examples
</div>
</div>
<div class="callout-body-container callout-body">
<div class="sourceClojure">
<div class="sourceCode" id="cb39"><pre class="sourceCode clojure code-with-copy"><code class="sourceCode clojure"><span id="cb39-1"><a href="#cb39-1" aria-hidden="true" tabindex="-1"></a>(special/hypergeometric<span class="dv">-0</span>F0 <span class="fl">2.3</span>) <span class="co">;; =&gt; 9.97418245481472</span></span>
<span id="cb39-2"><a href="#cb39-2" aria-hidden="true" tabindex="-1"></a>(m/exp <span class="fl">2.3</span>) <span class="co">;; =&gt; 9.97418245481472</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
</div>
</div>
</section>
<section id="f1" class="level3">
<h3 class="anchored" data-anchor-id="f1"><sub>0</sub>F<sub>1</sub></h3>
<p><span class="math inline">\({}_0F_1\)</span> is called confluent hypergeometric limit function.</p>
<p><span class="math display">\[{}_0F_1(;a;x)=\sum_{k=0}^\infty\frac{x^k}{(a)_k k!}=
\begin{cases}
1.0 &amp; x=0 \\
\frac{J_{a-1}\left(2\sqrt{|x|}\right)\Gamma(a)}{|x|^\frac{a-1}{2}} &amp; x&lt;0 \\
\frac{I_{a-1}\left(2\sqrt{|x|}\right)\Gamma(a)}{|x|^\frac{a-1}{2}} &amp; x&gt;0
\end{cases}
\]</span></p>
<div class="clay-image">
<img class="clay-image" src="special_files/57.png">
</div>
<div class="callout callout-style-default callout-note callout-titled" title="Examples">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Examples
</div>
</div>
<div class="callout-body-container callout-body">
<div class="sourceClojure">
<div class="sourceCode" id="cb40"><pre class="sourceCode clojure code-with-copy"><code class="sourceCode clojure"><span id="cb40-1"><a href="#cb40-1" aria-hidden="true" tabindex="-1"></a>(special/hypergeometric-pFq-ratio [] [-<span class="fl">0.5</span>] -<span class="dv">2</span>) <span class="co">;; =&gt; -0.08000465565839093</span></span>
<span id="cb40-2"><a href="#cb40-2" aria-hidden="true" tabindex="-1"></a>(special/hypergeometric<span class="dv">-0</span>F1 -<span class="fl">0.5</span> -<span class="dv">2</span>) <span class="co">;; =&gt; -0.08000465565839159</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
</div>
</div>
</section>
<section id="f2" class="level3">
<h3 class="anchored" data-anchor-id="f2"><sub>0</sub>F<sub>2</sub></h3>
<p><span class="math display">\[{}_0F_2(;a,b;x)=\sum_{k=0}^\infty\frac{x^k}{(a)_k(b)_k k!}\]</span></p>
<div class="clay-image">
<img class="clay-image" src="special_files/58.png">
</div>
<div class="callout callout-style-default callout-note callout-titled" title="Examples">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Examples
</div>
</div>
<div class="callout-body-container callout-body">
<div class="sourceClojure">
<div class="sourceCode" id="cb41"><pre class="sourceCode clojure code-with-copy"><code class="sourceCode clojure"><span id="cb41-1"><a href="#cb41-1" aria-hidden="true" tabindex="-1"></a>(special/hypergeometric-pFq-ratio [] [-<span class="fl">0.5</span> <span class="fl">0.5</span>] -<span class="dv">2</span>) <span class="co">;; =&gt; 0.1239850666953995</span></span>
<span id="cb41-2"><a href="#cb41-2" aria-hidden="true" tabindex="-1"></a>(special/hypergeometric<span class="dv">-0</span>F2 -<span class="fl">0.5</span> <span class="fl">0.5</span> -<span class="dv">2</span>) <span class="co">;; =&gt; 0.12398506669539959</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
</div>
</div>
</section>
<section id="f0" class="level3">
<h3 class="anchored" data-anchor-id="f0"><sub>1</sub>F<sub>0</sub></h3>
<p><span class="math display">\[{}_1F_0(a;;x)=\sum_{k=0}^\infty\frac{(a)_k x^k}{k!}=(1-x)^{-a}\]</span></p>
<div class="clay-image">
<img class="clay-image" src="special_files/59.png">
</div>
<div class="callout callout-style-default callout-note callout-titled" title="Examples">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Examples
</div>
</div>
<div class="callout-body-container callout-body">
<div class="sourceClojure">
<div class="sourceCode" id="cb42"><pre class="sourceCode clojure code-with-copy"><code class="sourceCode clojure"><span id="cb42-1"><a href="#cb42-1" aria-hidden="true" tabindex="-1"></a>(special/hypergeometric-pFq-ratio [<span class="fl">0.5</span>] [] -<span class="fl">0.5</span>) <span class="co">;; =&gt; 0.8164965809277258</span></span>
<span id="cb42-2"><a href="#cb42-2" aria-hidden="true" tabindex="-1"></a>(special/hypergeometric<span class="dv">-1</span>F0 <span class="fl">0.5</span> -<span class="fl">0.5</span>) <span class="co">;; =&gt; 0.816496580927726</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
</div>
</div>
</section>
<section id="f1-m" class="level3">
<h3 class="anchored" data-anchor-id="f1-m"><sub>1</sub>F<sub>1</sub>, M</h3>
<p>Confluent hypergeometric function of the first kind, Kummer’s M.</p>
<p><span class="math display">\[{}_1F_1(a;b;x)=M(a,b,x)=\sum_{k=0}^\infty\frac{(a)_k x^k}{(b)_k k!}\]</span></p>
<div class="clay-image">
<img class="clay-image" src="special_files/60.png">
</div>
<div class="callout callout-style-default callout-note callout-titled" title="Examples">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Examples
</div>
</div>
<div class="callout-body-container callout-body">
<div class="sourceClojure">
<div class="sourceCode" id="cb43"><pre class="sourceCode clojure code-with-copy"><code class="sourceCode clojure"><span id="cb43-1"><a href="#cb43-1" aria-hidden="true" tabindex="-1"></a>(special/hypergeometric-pFq-ratio [<span class="fl">0.5</span>] [<span class="dv">1</span>] -<span class="fl">0.5</span>) <span class="co">;; =&gt; 0.7910171621397194</span></span>
<span id="cb43-2"><a href="#cb43-2" aria-hidden="true" tabindex="-1"></a>(special/hypergeometric<span class="dv">-1</span>F1 <span class="fl">0.5</span> <span class="dv">1</span> -<span class="fl">0.5</span>) <span class="co">;; =&gt; 0.7910171621397188</span></span>
<span id="cb43-3"><a href="#cb43-3" aria-hidden="true" tabindex="-1"></a>(special/kummers-M <span class="fl">0.5</span> <span class="dv">1</span> -<span class="fl">0.5</span>) <span class="co">;; =&gt; 0.7910171621397188</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
</div>
</div>
</section>
<section id="f0-u" class="level3">
<h3 class="anchored" data-anchor-id="f0-u"><sub>2</sub>F<sub>0</sub>, U</h3>
<p><span class="math inline">\({}_2F_0\)</span> is related to the confluent hypergeometric function of the second kind, Tricomi’s U</p>
<p><span class="math display">\[{}_2F_0(a,b;;x)=\sum_{k=0}^\infty\frac{(a)_k (b)_k x^k}{k!}\]</span></p>
<div class="clay-image">
<img class="clay-image" src="special_files/61.png">
</div>
<div class="callout callout-style-default callout-note callout-titled" title="Examples">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Examples
</div>
</div>
<div class="callout-body-container callout-body">
<div class="sourceClojure">
<div class="sourceCode" id="cb44"><pre class="sourceCode clojure code-with-copy"><code class="sourceCode clojure"><span id="cb44-1"><a href="#cb44-1" aria-hidden="true" tabindex="-1"></a>(special/hypergeometric-pFq-ratio [<span class="fl">0.1</span> -<span class="fl">0.1</span>] [] <span class="fl">0.01</span>) <span class="co">;; =&gt; 0.9998994982635961</span></span>
<span id="cb44-2"><a href="#cb44-2" aria-hidden="true" tabindex="-1"></a>(special/hypergeometric<span class="dv">-2</span>F0 <span class="fl">0.1</span> -<span class="fl">0.1</span> <span class="fl">0.01</span>) <span class="co">;; =&gt; 0.9998994982635958</span></span>
<span id="cb44-3"><a href="#cb44-3" aria-hidden="true" tabindex="-1"></a>(special/hypergeometric<span class="dv">-2</span>F0 <span class="fl">0.1</span> -<span class="fl">0.1</span> <span class="fl">1.2</span>) <span class="co">;; =&gt; 0.987133788261332</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
</div>
</div>
<hr>
<p><span class="math display">\[U(a,b,x) \sim x^{-a}{}_2F_0(a,b;;-\frac{1}{x})\]</span></p>
<div class="clay-image">
<img class="clay-image" src="special_files/62.png">
</div>
<div class="callout callout-style-default callout-note callout-titled" title="Examples">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Examples
</div>
</div>
<div class="callout-body-container callout-body">
<div class="sourceClojure">
<div class="sourceCode" id="cb45"><pre class="sourceCode clojure code-with-copy"><code class="sourceCode clojure"><span id="cb45-1"><a href="#cb45-1" aria-hidden="true" tabindex="-1"></a>(special/tricomis-U <span class="fl">0.5</span> <span class="fl">0.2</span> <span class="fl">0.1</span>) <span class="co">;; =&gt; 1.090844545544952</span></span>
<span id="cb45-2"><a href="#cb45-2" aria-hidden="true" tabindex="-1"></a>(special/tricomis-U -<span class="fl">0.5</span> <span class="fl">0.2</span> <span class="fl">0.1</span>) <span class="co">;; =&gt; 0.5507462877526579</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
</div>
</div>
</section>
<section id="f1-gauss" class="level3">
<h3 class="anchored" data-anchor-id="f1-gauss"><sub>2</sub>F<sub>1</sub>, Gauss</h3>
<p>Gauss’ hypergeometric function <span class="math inline">\({}_2F_1\)</span>.</p>
<p><span class="math display">\[{}_2F_1(a,b;c;x)=\sum_{k=0}^\infty\frac{(a)_k (b)_k x^k}{(c)_k k!}\]</span></p>
<div class="clay-image">
<img class="clay-image" src="special_files/63.png">
</div>
<div class="callout callout-style-default callout-note callout-titled" title="Examples">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Examples
</div>
</div>
<div class="callout-body-container callout-body">
<div class="sourceClojure">
<div class="sourceCode" id="cb46"><pre class="sourceCode clojure code-with-copy"><code class="sourceCode clojure"><span id="cb46-1"><a href="#cb46-1" aria-hidden="true" tabindex="-1"></a>(special/hypergeometric-pFq-ratio [<span class="fl">1.1</span> -<span class="fl">0.1</span>] [<span class="fl">0.2</span>] <span class="fl">0.5</span>) <span class="co">;; =&gt; 0.5254580717634016</span></span>
<span id="cb46-2"><a href="#cb46-2" aria-hidden="true" tabindex="-1"></a>(special/hypergeometric<span class="dv">-2</span>F1 <span class="fl">1.1</span> -<span class="fl">0.1</span> <span class="fl">0.2</span> <span class="fl">0.5</span>) <span class="co">;; =&gt; 0.5254580717633999</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
</div>
</div>
</section>
<section id="whittaker-m-and-w" class="level3">
<h3 class="anchored" data-anchor-id="whittaker-m-and-w">Whittaker M and W</h3>
<p>Modified hypergeometric functions by Whittaker</p>
<p><span class="math display">\[M_{\kappa,\mu}\left(x\right)=e^{-\frac{1}{2}x}x^{\frac{1}{2}+\mu}M\left(\tfrac{1}{2}+\mu-\kappa,1+2\mu,x\right)\]</span> <span class="math display">\[W_{\kappa,\mu}\left(x\right)=e^{-\frac{1}{2}x}x^{\frac{1}{2}+\mu}U\left(\tfrac{1}{2}+\mu-\kappa,1+2\mu,x\right)\]</span></p>
<div class="clay-table">
<div>
<div class="table-responsive">
<table class="table table-hover clay-table" data-quarto-postprocess="true">
<tbody>
<tr class="odd">
<td><img src="special_files/64.png" class="clay-image img-fluid"></td>
<td><img src="special_files/65.png" class="clay-image img-fluid"></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="callout callout-style-default callout-note callout-titled" title="Examples">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Examples
</div>
</div>
<div class="callout-body-container callout-body">
<div class="sourceClojure">
<div class="sourceCode" id="cb47"><pre class="sourceCode clojure code-with-copy"><code class="sourceCode clojure"><span id="cb47-1"><a href="#cb47-1" aria-hidden="true" tabindex="-1"></a>(special/whittaker-M <span class="fl">0.3</span> <span class="fl">0.4</span> <span class="fl">1.2</span>) <span class="co">;; =&gt; 1.0250053521045672</span></span>
<span id="cb47-2"><a href="#cb47-2" aria-hidden="true" tabindex="-1"></a>(special/whittaker-W <span class="fl">0.3</span> <span class="fl">0.4</span> <span class="fl">1.2</span>) <span class="co">;; =&gt; 0.6219095691834272</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
</div>
</div>
</section>
</section>
<section id="other" class="level2">
<h2 class="anchored" data-anchor-id="other">Other</h2>
<div class="callout callout-style-default callout-tip callout-titled" title="Defined functions">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Defined functions
</div>
</div>
<div class="callout-body-container callout-body">
<ul>
<li><code>lambert-W</code> (<span class="math inline">\(W_0\)</span>), <code>lambert-W-1</code> (<span class="math inline">\(W_{-1}\)</span>)</li>
<li><code>harmonic-number</code></li>
<li><code>minkowski</code> - <span class="math inline">\(?(x)\)</span></li>
</ul>
</div>
</div>
<section id="lambert-w" class="level3">
<h3 class="anchored" data-anchor-id="lambert-w">Lambert W</h3>
<p>Lambert W is a function for which <span class="math inline">\(W(xe^x)=x\)</span>. There are two branches <span class="math inline">\(W_0\)</span> (<code>lambert-W</code>) and <span class="math inline">\(W_{-1}\)</span> (<code>lambert-W-1</code>).</p>
<p><span class="math display">\[
\begin{align}
W_0(xe^x)=x &amp; \text{ for } x\ge -1 \\
W_{-1}(xe^x)=x &amp; \text{ for } x\le -1
\end{align}
\]</span></p>
<p>domain of functions</p>
<p><span class="math display">\[
\begin{align}
W_0(t) &amp; \text{ for } t\in(-1/e,\infty) \\
W_{-1}(t) &amp; \text{ for } t\in(-1/e,0)
\end{align}
\]</span></p>
<div class="clay-image">
<img class="clay-image" src="special_files/66.png">
</div>
<div class="callout callout-style-default callout-note callout-titled" title="Examples">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Examples
</div>
</div>
<div class="callout-body-container callout-body">
<div class="sourceClojure">
<div class="sourceCode" id="cb48"><pre class="sourceCode clojure code-with-copy"><code class="sourceCode clojure"><span id="cb48-1"><a href="#cb48-1" aria-hidden="true" tabindex="-1"></a>(special/lambert-W m/E) <span class="co">;; =&gt; 1.0</span></span>
<span id="cb48-2"><a href="#cb48-2" aria-hidden="true" tabindex="-1"></a>(special/lambert-W (<span class="kw">*</span> <span class="fl">2.3</span> (m/exp <span class="fl">2.3</span>))) <span class="co">;; =&gt; 2.3</span></span>
<span id="cb48-3"><a href="#cb48-3" aria-hidden="true" tabindex="-1"></a>(special/lambert-W<span class="dv">-1</span> (<span class="kw">*</span> -<span class="dv">2</span> (m/exp -<span class="dv">2</span>))) <span class="co">;; =&gt; -2.0</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
</div>
</div>
</section>
<section id="harmonic-h" class="level3">
<h3 class="anchored" data-anchor-id="harmonic-h">Harmonic H</h3>
<p>Harmonic numbers</p>
<p><span class="math display">\[H_n=\int_0^1\frac{1-x^n}{1-x}\,dx=\operatorname{digamma}(x+1)+\gamma\]</span></p>
<p>For non-negative integers</p>
<p><span class="math display">\[H_n=\sum_{k=1}^n\frac{1}{k}\]</span></p>
<div class="clay-image">
<img class="clay-image" src="special_files/67.png">
</div>
<div class="callout callout-style-default callout-note callout-titled" title="Examples">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Examples
</div>
</div>
<div class="callout-body-container callout-body">
<div class="sourceClojure">
<div class="sourceCode" id="cb49"><pre class="sourceCode clojure code-with-copy"><code class="sourceCode clojure"><span id="cb49-1"><a href="#cb49-1" aria-hidden="true" tabindex="-1"></a>(special/harmonic-number <span class="dv">2</span>) <span class="co">;; =&gt; 1.5</span></span>
<span id="cb49-2"><a href="#cb49-2" aria-hidden="true" tabindex="-1"></a>(special/harmonic-number <span class="fl">2.5</span>) <span class="co">;; =&gt; 1.680372305546776</span></span>
<span id="cb49-3"><a href="#cb49-3" aria-hidden="true" tabindex="-1"></a>(special/harmonic-number <span class="dv">3</span>) <span class="co">;; =&gt; 1.8333333333333335</span></span>
<span id="cb49-4"><a href="#cb49-4" aria-hidden="true" tabindex="-1"></a>(special/harmonic-number -<span class="fl">0.5</span>) <span class="co">;; =&gt; -1.3862943611198908</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
</div>
</div>
<hr>
<p>Generalized harmonic numbers for <span class="math inline">\(m\neq0\)</span> or <span class="math inline">\(m\neq1\)</span></p>
<p><span class="math display">\[H_{n,m}=\zeta(m)-\zeta(m,n+1)\]</span> <span class="math display">\[H_{n,0}=n\text{, }H_{n,1}=H_n\]</span></p>
<p>For non-negative integer <code>n</code></p>
<p><span class="math display">\[H_{n,m}=\sum_{k=1}^n\frac{1}{k^m}\]</span></p>
<div class="clay-table">
<div>
<div class="table-responsive">
<table class="table table-hover clay-table" data-quarto-postprocess="true">
<tbody>
<tr class="odd">
<td><img src="special_files/68.png" class="clay-image img-fluid"></td>
<td><img src="special_files/69.png" class="clay-image img-fluid"></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="callout callout-style-default callout-note callout-titled" title="Examples">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Examples
</div>
</div>
<div class="callout-body-container callout-body">
<div class="sourceClojure">
<div class="sourceCode" id="cb50"><pre class="sourceCode clojure code-with-copy"><code class="sourceCode clojure"><span id="cb50-1"><a href="#cb50-1" aria-hidden="true" tabindex="-1"></a>(special/harmonic-number <span class="fl">2.2</span> -<span class="fl">0.5</span>) <span class="co">;; =&gt; 2.737173754376224</span></span>
<span id="cb50-2"><a href="#cb50-2" aria-hidden="true" tabindex="-1"></a>(special/harmonic-number <span class="fl">2.2</span> <span class="fl">0.5</span>) <span class="co">;; =&gt; 1.8306098144389147</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
</div>
</div>
</section>
<section id="minowski" class="level3">
<h3 class="anchored" data-anchor-id="minowski">Minowski</h3>
<p>Minkowski’s question mark <span class="math inline">\(?(x)\)</span> function.</p>
<div class="clay-image">
<img class="clay-image" src="special_files/70.png">
</div>
<div class="callout callout-style-default callout-note callout-titled" title="Examples">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Examples
</div>
</div>
<div class="callout-body-container callout-body">
<div class="sourceClojure">
<div class="sourceCode" id="cb51"><pre class="sourceCode clojure code-with-copy"><code class="sourceCode clojure"><span id="cb51-1"><a href="#cb51-1" aria-hidden="true" tabindex="-1"></a>(special/minkowski <span class="fl">0.5</span>) <span class="co">;; =&gt; 0.5</span></span>
<span id="cb51-2"><a href="#cb51-2" aria-hidden="true" tabindex="-1"></a>[(special/minkowski <span class="fl">0.2</span>) (<span class="kw">-</span> <span class="fl">1.0</span> (special/minkowski <span class="fl">0.8</span>))] <span class="co">;; =&gt; [0.0625 0.0625]</span></span>
<span id="cb51-3"><a href="#cb51-3" aria-hidden="true" tabindex="-1"></a>[(special/minkowski (<span class="kw">/</span> <span class="fl">0.5</span> <span class="fl">1.5</span>)) (<span class="kw">/</span> (special/minkowski <span class="fl">0.5</span>) <span class="dv">2</span>)] <span class="co">;; =&gt; [0.25 0.25]</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
</div>
</div>
</section>
</section>
<section id="reference" class="level2">
<h2 class="anchored" data-anchor-id="reference">Reference</h2>
<section id="fastmath.special" class="level3">
<h3 class="anchored" data-anchor-id="fastmath.special">fastmath.special</h3>
<p>Special functions for real arguments and value.</p>
<ul>
<li>Bessel J, Y, jinc</li>
<li>Modified Bessel I, K</li>
<li>Spherical Bessel j, y</li>
<li>Modified spherical Bessel i1, i2, k</li>
<li>Gamma, log, digamma, trigamma, polygamma, regularized, lower/upper incomplete</li>
<li>Beta, log, regularized, incomplete</li>
<li>Erf, inverse</li>
<li>Airy A, B with derivatives</li>
<li>Zeta (Riemann, Hurwitz), Eta (Dirichlet), Xi (Landau), Beta (Dirichlet)</li>
<li>Integrals: Si, Ci, li/Li, Ei, En, Ein</li>
<li>Hypergeometric 0F0, 0F1, 1F0, 1F1, 2F1, 2F0, 0F2, pFq, Kummers M, Tricomis U, Whittaker M and W</li>
<li>Lambert W (0 and -1)</li>
<li>Minkowski</li>
<li>Harmonic H</li>
</ul>
<span id="#LOS-Ci"></span>
<section id="ci" class="level4">
<h4 class="anchored" data-anchor-id="ci">Ci</h4>
<ul>
<li><code>(Ci x)</code></li>
</ul>
<p>Cosine integral</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/special.clj#L1433">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-Cin"></span>
</section>
<section id="cin" class="level4">
<h4 class="anchored" data-anchor-id="cin">Cin</h4>
<ul>
<li><code>(Cin x)</code></li>
</ul>
<p>Cosine integral, alternative definition</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/special.clj#L1507">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-E0"></span>
</section>
<section id="e0" class="level4">
<h4 class="anchored" data-anchor-id="e0">E0</h4>
<ul>
<li><code>(E0 x)</code></li>
</ul>
<p>Exponential integral E0</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/special.clj#L1550">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-E1"></span>
</section>
<section id="e1" class="level4">
<h4 class="anchored" data-anchor-id="e1">E1</h4>
<ul>
<li><code>(E1 x)</code></li>
</ul>
<p>Exponential integral E1 for positive real numbers</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/special.clj#L1555">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-Ei"></span>
</section>
<section id="ei" class="level4">
<h4 class="anchored" data-anchor-id="ei">Ei</h4>
<ul>
<li><code>(Ei x)</code></li>
</ul>
<p>Exponential integral</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/special.clj#L1801">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-Ein"></span>
</section>
<section id="ein" class="level4">
<h4 class="anchored" data-anchor-id="ein">Ein</h4>
<ul>
<li><code>(Ein x)</code></li>
</ul>
<p>Exponential integral, alternative definition</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/special.clj#L1582">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-En"></span>
</section>
<section id="en" class="level4">
<h4 class="anchored" data-anchor-id="en">En</h4>
<ul>
<li><code>(En n x)</code></li>
</ul>
<p>Generalized exponential integral En</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/special.clj#L1767">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-Li"></span>
</section>
<section id="li" class="level4">
<h4 class="anchored" data-anchor-id="li">Li</h4>
<ul>
<li><code>(Li x)</code></li>
</ul>
<p>Offset logarythmic integral</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/special.clj#L1839">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-Si"></span>
</section>
<section id="si" class="level4">
<h4 class="anchored" data-anchor-id="si">Si</h4>
<ul>
<li><code>(Si x)</code></li>
</ul>
<p>Sine integral</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/special.clj#L1359">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-airy-Ai"></span>
</section>
<section id="airy-ai" class="level4">
<h4 class="anchored" data-anchor-id="airy-ai">airy-Ai</h4>
<ul>
<li><code>(airy-Ai x)</code></li>
</ul>
<p>Airy Ai function</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/special.clj#L1873">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-airy-Ai'"></span>
</section>
<section id="airy-ai-1" class="level4">
<h4 class="anchored" data-anchor-id="airy-ai-1">airy-Ai’</h4>
<ul>
<li><code>(airy-Ai' x)</code></li>
</ul>
<p>First derivative of the Airy Ai function</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/special.clj#L1882">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-airy-Bi"></span>
</section>
<section id="airy-bi" class="level4">
<h4 class="anchored" data-anchor-id="airy-bi">airy-Bi</h4>
<ul>
<li><code>(airy-Bi x)</code></li>
</ul>
<p>Airy Bi function</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/special.clj#L1891">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-airy-Bi'"></span>
</section>
<section id="airy-bi-1" class="level4">
<h4 class="anchored" data-anchor-id="airy-bi-1">airy-Bi’</h4>
<ul>
<li><code>(airy-Bi' x)</code></li>
</ul>
<p>First derivative of the Airy Bi function</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/special.clj#L1900">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-bessel-I"></span>
</section>
<section id="bessel-i" class="level4">
<h4 class="anchored" data-anchor-id="bessel-i">bessel-I</h4>
<ul>
<li><code>(bessel-I order x)</code></li>
</ul>
<p>Modified Bessel function of the first kind of order v, I_v(x)</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/special.clj#L1191">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-bessel-I0"></span>
</section>
<section id="bessel-i0" class="level4">
<h4 class="anchored" data-anchor-id="bessel-i0">bessel-I0</h4>
<ul>
<li><code>(bessel-I0 x)</code></li>
</ul>
<p>Modified Bessel function of the first kind of order 0, I_0(x)</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/special.clj#L1070">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-bessel-I1"></span>
</section>
<section id="bessel-i1" class="level4">
<h4 class="anchored" data-anchor-id="bessel-i1">bessel-I1</h4>
<ul>
<li><code>(bessel-I1 x)</code></li>
</ul>
<p>Modified Bessel function of the first kind of order 1, I_0(x)</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/special.clj#L1096">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-bessel-J"></span>
</section>
<section id="bessel-j" class="level4">
<h4 class="anchored" data-anchor-id="bessel-j">bessel-J</h4>
<ul>
<li><code>(bessel-J order x)</code></li>
</ul>
<p>Bessel function of the first kind of order v, J_v(x)</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/special.clj#L574">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-bessel-J0"></span>
</section>
<section id="bessel-j0" class="level4">
<h4 class="anchored" data-anchor-id="bessel-j0">bessel-J0</h4>
<ul>
<li><code>(bessel-J0 x)</code></li>
</ul>
<p>Bessel function of the first kind of order 0, J_0(x)</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/special.clj#L364">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-bessel-J1"></span>
</section>
<section id="bessel-j1" class="level4">
<h4 class="anchored" data-anchor-id="bessel-j1">bessel-J1</h4>
<ul>
<li><code>(bessel-J1 x)</code></li>
</ul>
<p>Bessel function of the first kind of order 1, J_1(x)</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/special.clj#L394">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-bessel-K"></span>
</section>
<section id="bessel-k" class="level4">
<h4 class="anchored" data-anchor-id="bessel-k">bessel-K</h4>
<ul>
<li><code>(bessel-K order x)</code></li>
</ul>
<p>Modified Bessel function of the second kind and real order v, K_v(x)</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/special.clj#L1039">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-bessel-K-half-odd"></span>
</section>
<section id="bessel-k-half-odd" class="level4">
<h4 class="anchored" data-anchor-id="bessel-k-half-odd">bessel-K-half-odd</h4>
<ul>
<li><code>(bessel-K-half-odd odd-numerator x)</code></li>
</ul>
<p>Bessel K_a function for a = order/2</p>
<p>Function accepts only odd integers for order</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/special.clj#L791">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-bessel-K0"></span>
</section>
<section id="bessel-k0" class="level4">
<h4 class="anchored" data-anchor-id="bessel-k0">bessel-K0</h4>
<ul>
<li><code>(bessel-K0 x)</code></li>
</ul>
<p>Modified Bessel function of the second kind of order 0, K_0(x)</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/special.clj#L809">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-bessel-K1"></span>
</section>
<section id="bessel-k1" class="level4">
<h4 class="anchored" data-anchor-id="bessel-k1">bessel-K1</h4>
<ul>
<li><code>(bessel-K1 x)</code></li>
</ul>
<p>Modified Bessel function of the second kind of order 1, K_1(x)</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/special.clj#L847">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-bessel-Y"></span>
</section>
<section id="bessel-y" class="level4">
<h4 class="anchored" data-anchor-id="bessel-y">bessel-Y</h4>
<ul>
<li><code>(bessel-Y order x)</code></li>
</ul>
<p>Bessel function of the second kind of order v, Y_v(x)</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/special.clj#L769">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-bessel-Y0"></span>
</section>
<section id="bessel-y0" class="level4">
<h4 class="anchored" data-anchor-id="bessel-y0">bessel-Y0</h4>
<ul>
<li><code>(bessel-Y0 x)</code></li>
</ul>
<p>Bessel function of the second kind of order 0, Y_0(x)</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/special.clj#L595">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-bessel-Y1"></span>
</section>
<section id="bessel-y1" class="level4">
<h4 class="anchored" data-anchor-id="bessel-y1">bessel-Y1</h4>
<ul>
<li><code>(bessel-Y1 x)</code></li>
</ul>
<p>Bessel function of the second kind of order 1, Y_1(x)</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/special.clj#L647">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-beta"></span>
</section>
<section id="beta-2" class="level4">
<h4 class="anchored" data-anchor-id="beta-2">beta</h4>
<ul>
<li><code>(beta p q)</code></li>
</ul>
<p>Beta function</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/special.clj#L134">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-digamma"></span>
</section>
<section id="digamma" class="level4">
<h4 class="anchored" data-anchor-id="digamma">digamma</h4>
<ul>
<li><code>(digamma x)</code></li>
</ul>
<p>First derivative of log of Gamma function.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/special.clj#L88">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-dirichlet-beta"></span>
</section>
<section id="dirichlet-beta" class="level4">
<h4 class="anchored" data-anchor-id="dirichlet-beta">dirichlet-beta</h4>
<ul>
<li><code>(dirichlet-beta x)</code></li>
</ul>
<p>Dirichlet Beta function</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/special.clj#L271">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-erf"></span>
</section>
<section id="erf-1" class="level4">
<h4 class="anchored" data-anchor-id="erf-1">erf</h4>
<ul>
<li><code>(erf x)</code></li>
<li><code>(erf x1 x2)</code></li>
</ul>
<p>Error function.</p>
<p>For two arguments returns a difference between <code>(erf x2)</code> and <code>(erf x1)</code>.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/special.clj#L34">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-erfc"></span>
</section>
<section id="erfc" class="level4">
<h4 class="anchored" data-anchor-id="erfc">erfc</h4>
<ul>
<li><code>(erfc x)</code></li>
</ul>
<p>Complementary error function.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/special.clj#L44">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-eta"></span>
</section>
<section id="eta-1" class="level4">
<h4 class="anchored" data-anchor-id="eta-1">eta</h4>
<ul>
<li><code>(eta x)</code></li>
</ul>
<p>Dirichlet Eta function</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/special.clj#L256">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-gamma"></span>
</section>
<section id="gamma-1" class="level4">
<h4 class="anchored" data-anchor-id="gamma-1">gamma</h4>
<ul>
<li><code>(gamma x)</code></li>
</ul>
<p>Gamma function <span class="math inline">\(\Gamma(x)\)</span>. Extension of the factorial.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/special.clj#L64">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-harmonic-number"></span>
</section>
<section id="harmonic-number" class="level4">
<h4 class="anchored" data-anchor-id="harmonic-number">harmonic-number</h4>
<ul>
<li><code>(harmonic-number n)</code></li>
<li><code>(harmonic-number n m)</code></li>
</ul>
<p>Harmonic number H_n or generalized harmonic number H_n,m</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/special.clj#L1911">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-hypergeometric-0F0"></span>
</section>
<section id="hypergeometric-0f0" class="level4">
<h4 class="anchored" data-anchor-id="hypergeometric-0f0">hypergeometric-0F0</h4>
<ul>
<li><code>(hypergeometric-0F0 x)</code></li>
</ul>
<p>Hypergeometric ₀F₀ function, exp(x)</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/special.clj#L2005">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-hypergeometric-0F1"></span>
</section>
<section id="hypergeometric-0f1" class="level4">
<h4 class="anchored" data-anchor-id="hypergeometric-0f1">hypergeometric-0F1</h4>
<ul>
<li><code>(hypergeometric-0F1 a x)</code></li>
</ul>
<p>Confluent hypergeometric ₀F₁ limit function.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/special.clj#L2014">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-hypergeometric-0F2"></span>
</section>
<section id="hypergeometric-0f2" class="level4">
<h4 class="anchored" data-anchor-id="hypergeometric-0f2">hypergeometric-0F2</h4>
<ul>
<li><code>(hypergeometric-0F2 a b x)</code></li>
</ul>
<p>Generalized hypergeometric ₀F₂ function.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/special.clj#L2033">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-hypergeometric-1F0"></span>
</section>
<section id="hypergeometric-1f0" class="level4">
<h4 class="anchored" data-anchor-id="hypergeometric-1f0">hypergeometric-1F0</h4>
<ul>
<li><code>(hypergeometric-1F0 a x)</code></li>
</ul>
<p>Hypergeometric ₁F₀ function.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/special.clj#L2009">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-hypergeometric-1F1"></span>
</section>
<section id="hypergeometric-1f1" class="level4">
<h4 class="anchored" data-anchor-id="hypergeometric-1f1">hypergeometric-1F1</h4>
<ul>
<li><code>(hypergeometric-1F1 a b x)</code></li>
</ul>
<p>Confluent hypergeometric ₁F₁ function of the first kind, Kummer’s M.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/special.clj#L2028">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-hypergeometric-2F0"></span>
</section>
<section id="hypergeometric-2f0" class="level4">
<h4 class="anchored" data-anchor-id="hypergeometric-2f0">hypergeometric-2F0</h4>
<ul>
<li><code>(hypergeometric-2F0 a b x)</code></li>
</ul>
<p>Generalized hypergeometric ₂F₀ function.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/special.clj#L2040">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-hypergeometric-2F1"></span>
</section>
<section id="hypergeometric-2f1" class="level4">
<h4 class="anchored" data-anchor-id="hypergeometric-2f1">hypergeometric-2F1</h4>
<ul>
<li><code>(hypergeometric-2F1 a b c x)</code></li>
</ul>
<p>Gauss’s hypergeometric ₂F₁ function.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/special.clj#L2064">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-hypergeometric-pFq"></span>
</section>
<section id="hypergeometric-pfq" class="level4">
<h4 class="anchored" data-anchor-id="hypergeometric-pfq">hypergeometric-pFq</h4>
<ul>
<li><code>(hypergeometric-pFq ps qs z)</code></li>
<li><code>(hypergeometric-pFq ps qs z max-iters)</code></li>
</ul>
<p>hypergeometric-pFq using MacLaurin series.</p>
<p><code>max-iters</code> is set to 1000000 by default.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/special.clj#L2083">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-hypergeometric-pFq-ratio"></span>
</section>
<section id="hypergeometric-pfq-ratio" class="level4">
<h4 class="anchored" data-anchor-id="hypergeometric-pfq-ratio">hypergeometric-pFq-ratio</h4>
<ul>
<li><code>(hypergeometric-pFq-ratio ps qs z)</code></li>
<li><code>(hypergeometric-pFq-ratio ps qs z max-iters)</code></li>
</ul>
<p>Hypergeometric-pFq using MacLaurin series on ratios. Can be very slow.</p>
<p><code>max-iters</code> is set to 10000 by default.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/special.clj#L2106">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-incomplete-beta"></span>
</section>
<section id="incomplete-beta" class="level4">
<h4 class="anchored" data-anchor-id="incomplete-beta">incomplete-beta</h4>
<ul>
<li><code>(incomplete-beta x a b)</code></li>
</ul>
<p>Incomplete Beta B(x,a,b)</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/special.clj#L150">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-inv-erf"></span>
</section>
<section id="inv-erf" class="level4">
<h4 class="anchored" data-anchor-id="inv-erf">inv-erf</h4>
<ul>
<li><code>(inv-erf x)</code></li>
</ul>
<p>Inverse of <a href="#LOS-erf">erf</a> function.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/special.clj#L50">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-inv-erfc"></span>
</section>
<section id="inv-erfc" class="level4">
<h4 class="anchored" data-anchor-id="inv-erfc">inv-erfc</h4>
<ul>
<li><code>(inv-erfc x)</code></li>
</ul>
<p>Inverse of <a href="#LOS-erfc">erfc</a> function.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/special.clj#L56">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-inv-gamma-1pm1"></span>
</section>
<section id="inv-gamma-1pm1" class="level4">
<h4 class="anchored" data-anchor-id="inv-gamma-1pm1">inv-gamma-1pm1</h4>
<ul>
<li><code>(inv-gamma-1pm1 x)</code></li>
</ul>
<p><span class="math inline">\(\frac{1}{\Gamma(1+x)}-1\)</span> for <span class="math inline">\(-0.5≤x≤1.5\)</span>.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/special.clj#L82">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-jinc"></span>
</section>
<section id="jinc" class="level4">
<h4 class="anchored" data-anchor-id="jinc">jinc</h4>
<ul>
<li><code>(jinc x)</code></li>
</ul>
<p>Besselj1 devided by <code>x</code></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/special.clj#L428">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-kummers-M"></span>
</section>
<section id="kummers-m" class="level4">
<h4 class="anchored" data-anchor-id="kummers-m">kummers-M</h4>
<ul>
<li><code>(kummers-M a b x)</code></li>
</ul>
<p>Kummer’s (confluent hypergeometric, 1F1) function for real arguments.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/special.clj#L1970">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-lambert-W"></span>
</section>
<section id="lambert-w-1" class="level4">
<h4 class="anchored" data-anchor-id="lambert-w-1">lambert-W</h4>
<ul>
<li><code>(lambert-W x)</code></li>
</ul>
<p>Lambert W_0 function. W(xe^x)=x for x&gt;=-1.0.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/special.clj#L1940">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-lambert-W-1"></span>
</section>
<section id="lambert-w-1-1" class="level4">
<h4 class="anchored" data-anchor-id="lambert-w-1-1">lambert-W-1</h4>
<ul>
<li><code>(lambert-W-1 x)</code></li>
</ul>
<p>Lambert W_1 function. W_1(xe^x)=x for x&lt;=-1.0.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/special.clj#L1956">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-li"></span>
</section>
<section id="li-1" class="level4">
<h4 class="anchored" data-anchor-id="li-1">li</h4>
<ul>
<li><code>(li x)</code></li>
</ul>
<p>Logarythmic integral</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/special.clj#L1834">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-log-beta"></span>
</section>
<section id="log-beta" class="level4">
<h4 class="anchored" data-anchor-id="log-beta">log-beta</h4>
<ul>
<li><code>(log-beta p q)</code></li>
</ul>
<p>Logarithm of Beta function.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/special.clj#L128">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-log-gamma"></span>
</section>
<section id="log-gamma-1" class="level4">
<h4 class="anchored" data-anchor-id="log-gamma-1">log-gamma</h4>
<ul>
<li><code>(log-gamma x)</code></li>
</ul>
<p>Log of Gamma function <span class="math inline">\(\log\Gamma(x)\)</span>.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/special.clj#L70">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-log-gamma-1p"></span>
</section>
<section id="log-gamma-1p" class="level4">
<h4 class="anchored" data-anchor-id="log-gamma-1p">log-gamma-1p</h4>
<ul>
<li><code>(log-gamma-1p x)</code></li>
</ul>
<p><span class="math inline">\(\ln\Gamma(1+x)\)</span> for <span class="math inline">\(-0.5≤x≤1.5\)</span>.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/special.clj#L76">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-lower-incomplete-gamma"></span>
</section>
<section id="lower-incomplete-gamma" class="level4">
<h4 class="anchored" data-anchor-id="lower-incomplete-gamma">lower-incomplete-gamma</h4>
<ul>
<li><code>(lower-incomplete-gamma s x)</code></li>
</ul>
<p>Lower incomplete gamma function</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/special.clj#L1853">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-minkowski"></span>
</section>
<section id="minkowski" class="level4">
<h4 class="anchored" data-anchor-id="minkowski">minkowski</h4>
<ul>
<li><code>(minkowski x)</code></li>
</ul>
<p>Minkowski’s question mark function ?(x)</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/special.clj#L1344">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-polygamma"></span>
</section>
<section id="polygamma" class="level4">
<h4 class="anchored" data-anchor-id="polygamma">polygamma</h4>
<ul>
<li><code>(polygamma m x)</code></li>
</ul>
<p>Polygamma function of order <code>m</code> and real argument.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/special.clj#L344">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-regularized-beta"></span>
</section>
<section id="regularized-beta" class="level4">
<h4 class="anchored" data-anchor-id="regularized-beta">regularized-beta</h4>
<ul>
<li><code>(regularized-beta x a b)</code></li>
</ul>
<p>Regularized Beta I_x(a,b)</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/special.clj#L141">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-regularized-gamma-p"></span>
</section>
<section id="regularized-gamma-p" class="level4">
<h4 class="anchored" data-anchor-id="regularized-gamma-p">regularized-gamma-p</h4>
<ul>
<li><code>(regularized-gamma-p a x)</code></li>
</ul>
<p>Regularized gamma P(a,x)</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/special.clj#L1857">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-regularized-gamma-q"></span>
</section>
<section id="regularized-gamma-q" class="level4">
<h4 class="anchored" data-anchor-id="regularized-gamma-q">regularized-gamma-q</h4>
<ul>
<li><code>(regularized-gamma-q a x)</code></li>
</ul>
<p>Regularized gamma Q(a,x)</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/special.clj#L1864">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-si"></span>
</section>
<section id="si-1" class="level4">
<h4 class="anchored" data-anchor-id="si-1">si</h4>
<ul>
<li><code>(si x)</code></li>
</ul>
<p>Sine integral, Si shifted by -pi/2</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/special.clj#L1422">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-spherical-bessel-1-i"></span>
</section>
<section id="spherical-bessel-1-i" class="level4">
<h4 class="anchored" data-anchor-id="spherical-bessel-1-i">spherical-bessel-1-i</h4>
<ul>
<li><code>(spherical-bessel-1-i order x)</code></li>
</ul>
<p>First modified spherical Bessel function of the first kind.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/special.clj#L1288">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-spherical-bessel-1-i0"></span>
</section>
<section id="spherical-bessel-1-i0" class="level4">
<h4 class="anchored" data-anchor-id="spherical-bessel-1-i0">spherical-bessel-1-i0</h4>
<ul>
<li><code>(spherical-bessel-1-i0 x)</code></li>
</ul>
<p>First modified spherical Bessel function of the first kind and order 0.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/special.clj#L1268">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-spherical-bessel-1-i1"></span>
</section>
<section id="spherical-bessel-1-i1" class="level4">
<h4 class="anchored" data-anchor-id="spherical-bessel-1-i1">spherical-bessel-1-i1</h4>
<ul>
<li><code>(spherical-bessel-1-i1 x)</code></li>
</ul>
<p>First modified spherical Bessel function of the first kind and order 1.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/special.clj#L1274">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-spherical-bessel-1-i2"></span>
</section>
<section id="spherical-bessel-1-i2" class="level4">
<h4 class="anchored" data-anchor-id="spherical-bessel-1-i2">spherical-bessel-1-i2</h4>
<ul>
<li><code>(spherical-bessel-1-i2 x)</code></li>
</ul>
<p>First modified spherical Bessel function of the first kind and order 2.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/special.clj#L1280">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-spherical-bessel-2-i"></span>
</section>
<section id="spherical-bessel-2-i" class="level4">
<h4 class="anchored" data-anchor-id="spherical-bessel-2-i">spherical-bessel-2-i</h4>
<ul>
<li><code>(spherical-bessel-2-i order x)</code></li>
</ul>
<p>Second modified spherical Bessel function of the first kind.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/special.clj#L1311">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-spherical-bessel-2-i0"></span>
</section>
<section id="spherical-bessel-2-i0" class="level4">
<h4 class="anchored" data-anchor-id="spherical-bessel-2-i0">spherical-bessel-2-i0</h4>
<ul>
<li><code>(spherical-bessel-2-i0 x)</code></li>
</ul>
<p>Second modified spherical Bessel function of the first kind and order 0.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/special.clj#L1297">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-spherical-bessel-2-i1"></span>
</section>
<section id="spherical-bessel-2-i1" class="level4">
<h4 class="anchored" data-anchor-id="spherical-bessel-2-i1">spherical-bessel-2-i1</h4>
<ul>
<li><code>(spherical-bessel-2-i1 x)</code></li>
</ul>
<p>Second modified spherical Bessel function of the first kind and order 1.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/special.clj#L1301">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-spherical-bessel-2-i2"></span>
</section>
<section id="spherical-bessel-2-i2" class="level4">
<h4 class="anchored" data-anchor-id="spherical-bessel-2-i2">spherical-bessel-2-i2</h4>
<ul>
<li><code>(spherical-bessel-2-i2 x)</code></li>
</ul>
<p>Second modified spherical Bessel function of the first kind and order 2.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/special.clj#L1305">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-spherical-bessel-j"></span>
</section>
<section id="spherical-bessel-j" class="level4">
<h4 class="anchored" data-anchor-id="spherical-bessel-j">spherical-bessel-j</h4>
<ul>
<li><code>(spherical-bessel-j order x)</code></li>
</ul>
<p>Spherical Bessel function of the first kind.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/special.clj#L1229">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-spherical-bessel-j0"></span>
</section>
<section id="spherical-bessel-j0" class="level4">
<h4 class="anchored" data-anchor-id="spherical-bessel-j0">spherical-bessel-j0</h4>
<ul>
<li><code>(spherical-bessel-j0 x)</code></li>
</ul>
<p>Spherical Bessel function of the first kind and order 0.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/special.clj#L1208">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-spherical-bessel-j1"></span>
</section>
<section id="spherical-bessel-j1" class="level4">
<h4 class="anchored" data-anchor-id="spherical-bessel-j1">spherical-bessel-j1</h4>
<ul>
<li><code>(spherical-bessel-j1 x)</code></li>
</ul>
<p>Spherical Bessel function of the first kind and order 1.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/special.clj#L1214">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-spherical-bessel-j2"></span>
</section>
<section id="spherical-bessel-j2" class="level4">
<h4 class="anchored" data-anchor-id="spherical-bessel-j2">spherical-bessel-j2</h4>
<ul>
<li><code>(spherical-bessel-j2 x)</code></li>
</ul>
<p>Spherical Bessel function of the first kind and order 2.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/special.clj#L1221">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-spherical-bessel-k"></span>
</section>
<section id="spherical-bessel-k" class="level4">
<h4 class="anchored" data-anchor-id="spherical-bessel-k">spherical-bessel-k</h4>
<ul>
<li><code>(spherical-bessel-k order x)</code></li>
</ul>
<p>Modified spherical Bessel function of the second kind.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/special.clj#L1333">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-spherical-bessel-k0"></span>
</section>
<section id="spherical-bessel-k0" class="level4">
<h4 class="anchored" data-anchor-id="spherical-bessel-k0">spherical-bessel-k0</h4>
<ul>
<li><code>(spherical-bessel-k0 x)</code></li>
</ul>
<p>Modified spherical Bessel function of the second kind and order 0.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/special.clj#L1320">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-spherical-bessel-k1"></span>
</section>
<section id="spherical-bessel-k1" class="level4">
<h4 class="anchored" data-anchor-id="spherical-bessel-k1">spherical-bessel-k1</h4>
<ul>
<li><code>(spherical-bessel-k1 x)</code></li>
</ul>
<p>Modified spherical Bessel function of the second kind and order 1.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/special.clj#L1324">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-spherical-bessel-k2"></span>
</section>
<section id="spherical-bessel-k2" class="level4">
<h4 class="anchored" data-anchor-id="spherical-bessel-k2">spherical-bessel-k2</h4>
<ul>
<li><code>(spherical-bessel-k2 x)</code></li>
</ul>
<p>Modified spherical Bessel function of the second kind and order 2.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/special.clj#L1328">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-spherical-bessel-y"></span>
</section>
<section id="spherical-bessel-y" class="level4">
<h4 class="anchored" data-anchor-id="spherical-bessel-y">spherical-bessel-y</h4>
<ul>
<li><code>(spherical-bessel-y order x)</code></li>
</ul>
<p>Spherical Bessel function of the second kind.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/special.clj#L1259">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-spherical-bessel-y0"></span>
</section>
<section id="spherical-bessel-y0" class="level4">
<h4 class="anchored" data-anchor-id="spherical-bessel-y0">spherical-bessel-y0</h4>
<ul>
<li><code>(spherical-bessel-y0 x)</code></li>
</ul>
<p>Spherical Bessel function of the second kind and order 0.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/special.clj#L1238">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-spherical-bessel-y1"></span>
</section>
<section id="spherical-bessel-y1" class="level4">
<h4 class="anchored" data-anchor-id="spherical-bessel-y1">spherical-bessel-y1</h4>
<ul>
<li><code>(spherical-bessel-y1 x)</code></li>
</ul>
<p>Spherical Bessel function of the second kind and order 1.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/special.clj#L1244">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-spherical-bessel-y2"></span>
</section>
<section id="spherical-bessel-y2" class="level4">
<h4 class="anchored" data-anchor-id="spherical-bessel-y2">spherical-bessel-y2</h4>
<ul>
<li><code>(spherical-bessel-y2 x)</code></li>
</ul>
<p>Spherical Bessel function of the second kind and order 2.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/special.clj#L1251">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-tricomis-U"></span>
</section>
<section id="tricomis-u" class="level4">
<h4 class="anchored" data-anchor-id="tricomis-u">tricomis-U</h4>
<ul>
<li><code>(tricomis-U a b x)</code></li>
</ul>
<p>Confluent hypergeometric function U of the second kind.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/special.clj#L2045">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-trigamma"></span>
</section>
<section id="trigamma" class="level4">
<h4 class="anchored" data-anchor-id="trigamma">trigamma</h4>
<ul>
<li><code>(trigamma x)</code></li>
</ul>
<p>Second derivative of log of Gamma function.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/special.clj#L108">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-upper-incomplete-gamma"></span>
</section>
<section id="upper-incomplete-gamma" class="level4">
<h4 class="anchored" data-anchor-id="upper-incomplete-gamma">upper-incomplete-gamma</h4>
<ul>
<li><code>(upper-incomplete-gamma s x)</code></li>
</ul>
<p>Upper incomplete gamma function</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/special.clj#L1846">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-whittaker-M"></span>
</section>
<section id="whittaker-m" class="level4">
<h4 class="anchored" data-anchor-id="whittaker-m">whittaker-M</h4>
<ul>
<li><code>(whittaker-M kappa mu x)</code></li>
</ul>
<p>Whittaker’s M</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/special.clj#L1998">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-whittaker-W"></span>
</section>
<section id="whittaker-w" class="level4">
<h4 class="anchored" data-anchor-id="whittaker-w">whittaker-W</h4>
<ul>
<li><code>(whittaker-W kappa mu x)</code></li>
</ul>
<p>Whittaker’s W</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/special.clj#L2057">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-xi"></span>
</section>
<section id="xi-1" class="level4">
<h4 class="anchored" data-anchor-id="xi-1">xi</h4>
<ul>
<li><code>(xi s)</code></li>
</ul>
<p>Riemann (Landau’s) Xi function</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/special.clj#L277">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-zeta"></span>
</section>
<section id="zeta-1" class="level4">
<h4 class="anchored" data-anchor-id="zeta-1">zeta</h4>
<ul>
<li><code>(zeta s)</code></li>
<li><code>(zeta s z)</code></li>
</ul>
<p>Riemann and Hurwitz zeta functions for real arguments</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/special.clj#L215">source</a></small><hr style="margin: 0"></div>
<div style="background-color:grey;height:2px;width:100%;"></div>
<div><pre><small><small>source: <a href="https://github.com/generateme/fastmath//blob/master/clay/special.clj">clay/special.clj</a></small></small></pre></div>


</section>
</section>
</section>

</main> <!-- /main -->
<script id="quarto-html-after-body" type="application/javascript">
window.document.addEventListener("DOMContentLoaded", function (event) {
  const toggleBodyColorMode = (bsSheetEl) => {
    const mode = bsSheetEl.getAttribute("data-mode");
    const bodyEl = window.document.querySelector("body");
    if (mode === "dark") {
      bodyEl.classList.add("quarto-dark");
      bodyEl.classList.remove("quarto-light");
    } else {
      bodyEl.classList.add("quarto-light");
      bodyEl.classList.remove("quarto-dark");
    }
  }
  const toggleBodyColorPrimary = () => {
    const bsSheetEl = window.document.querySelector("link#quarto-bootstrap");
    if (bsSheetEl) {
      toggleBodyColorMode(bsSheetEl);
    }
  }
  toggleBodyColorPrimary();  
  const icon = "";
  const anchorJS = new window.AnchorJS();
  anchorJS.options = {
    placement: 'right',
    icon: icon
  };
  anchorJS.add('.anchored');
  const isCodeAnnotation = (el) => {
    for (const clz of el.classList) {
      if (clz.startsWith('code-annotation-')) {                     
        return true;
      }
    }
    return false;
  }
  const clipboard = new window.ClipboardJS('.code-copy-button', {
    text: function(trigger) {
      const codeEl = trigger.previousElementSibling.cloneNode(true);
      for (const childEl of codeEl.children) {
        if (isCodeAnnotation(childEl)) {
          childEl.remove();
        }
      }
      return codeEl.innerText;
    }
  });
  clipboard.on('success', function(e) {
    // button target
    const button = e.trigger;
    // don't keep focus
    button.blur();
    // flash "checked"
    button.classList.add('code-copy-button-checked');
    var currentTitle = button.getAttribute("title");
    button.setAttribute("title", "Copied!");
    let tooltip;
    if (window.bootstrap) {
      button.setAttribute("data-bs-toggle", "tooltip");
      button.setAttribute("data-bs-placement", "left");
      button.setAttribute("data-bs-title", "Copied!");
      tooltip = new bootstrap.Tooltip(button, 
        { trigger: "manual", 
          customClass: "code-copy-button-tooltip",
          offset: [0, -8]});
      tooltip.show();    
    }
    setTimeout(function() {
      if (tooltip) {
        tooltip.hide();
        button.removeAttribute("data-bs-title");
        button.removeAttribute("data-bs-toggle");
        button.removeAttribute("data-bs-placement");
      }
      button.setAttribute("title", currentTitle);
      button.classList.remove('code-copy-button-checked');
    }, 1000);
    // clear code selection
    e.clearSelection();
  });
  function tippyHover(el, contentFn, onTriggerFn, onUntriggerFn) {
    const config = {
      allowHTML: true,
      maxWidth: 500,
      delay: 100,
      arrow: false,
      appendTo: function(el) {
          return el.parentElement;
      },
      interactive: true,
      interactiveBorder: 10,
      theme: 'quarto',
      placement: 'bottom-start',
    };
    if (contentFn) {
      config.content = contentFn;
    }
    if (onTriggerFn) {
      config.onTrigger = onTriggerFn;
    }
    if (onUntriggerFn) {
      config.onUntrigger = onUntriggerFn;
    }
    window.tippy(el, config); 
  }
  const noterefs = window.document.querySelectorAll('a[role="doc-noteref"]');
  for (var i=0; i<noterefs.length; i++) {
    const ref = noterefs[i];
    tippyHover(ref, function() {
      // use id or data attribute instead here
      let href = ref.getAttribute('data-footnote-href') || ref.getAttribute('href');
      try { href = new URL(href).hash; } catch {}
      const id = href.replace(/^#\/?/, "");
      const note = window.document.getElementById(id);
      return note.innerHTML;
    });
  }
  const xrefs = window.document.querySelectorAll('a.quarto-xref');
  const processXRef = (id, note) => {
    // Strip column container classes
    const stripColumnClz = (el) => {
      el.classList.remove("page-full", "page-columns");
      if (el.children) {
        for (const child of el.children) {
          stripColumnClz(child);
        }
      }
    }
    stripColumnClz(note)
    if (id === null || id.startsWith('sec-')) {
      // Special case sections, only their first couple elements
      const container = document.createElement("div");
      if (note.children && note.children.length > 2) {
        container.appendChild(note.children[0].cloneNode(true));
        for (let i = 1; i < note.children.length; i++) {
          const child = note.children[i];
          if (child.tagName === "P" && child.innerText === "") {
            continue;
          } else {
            container.appendChild(child.cloneNode(true));
            break;
          }
        }
        if (window.Quarto?.typesetMath) {
          window.Quarto.typesetMath(container);
        }
        return container.innerHTML
      } else {
        if (window.Quarto?.typesetMath) {
          window.Quarto.typesetMath(note);
        }
        return note.innerHTML;
      }
    } else {
      // Remove any anchor links if they are present
      const anchorLink = note.querySelector('a.anchorjs-link');
      if (anchorLink) {
        anchorLink.remove();
      }
      if (window.Quarto?.typesetMath) {
        window.Quarto.typesetMath(note);
      }
      // TODO in 1.5, we should make sure this works without a callout special case
      if (note.classList.contains("callout")) {
        return note.outerHTML;
      } else {
        return note.innerHTML;
      }
    }
  }
  for (var i=0; i<xrefs.length; i++) {
    const xref = xrefs[i];
    tippyHover(xref, undefined, function(instance) {
      instance.disable();
      let url = xref.getAttribute('href');
      let hash = undefined; 
      if (url.startsWith('#')) {
        hash = url;
      } else {
        try { hash = new URL(url).hash; } catch {}
      }
      if (hash) {
        const id = hash.replace(/^#\/?/, "");
        const note = window.document.getElementById(id);
        if (note !== null) {
          try {
            const html = processXRef(id, note.cloneNode(true));
            instance.setContent(html);
          } finally {
            instance.enable();
            instance.show();
          }
        } else {
          // See if we can fetch this
          fetch(url.split('#')[0])
          .then(res => res.text())
          .then(html => {
            const parser = new DOMParser();
            const htmlDoc = parser.parseFromString(html, "text/html");
            const note = htmlDoc.getElementById(id);
            if (note !== null) {
              const html = processXRef(id, note);
              instance.setContent(html);
            } 
          }).finally(() => {
            instance.enable();
            instance.show();
          });
        }
      } else {
        // See if we can fetch a full url (with no hash to target)
        // This is a special case and we should probably do some content thinning / targeting
        fetch(url)
        .then(res => res.text())
        .then(html => {
          const parser = new DOMParser();
          const htmlDoc = parser.parseFromString(html, "text/html");
          const note = htmlDoc.querySelector('main.content');
          if (note !== null) {
            // This should only happen for chapter cross references
            // (since there is no id in the URL)
            // remove the first header
            if (note.children.length > 0 && note.children[0].tagName === "HEADER") {
              note.children[0].remove();
            }
            const html = processXRef(null, note);
            instance.setContent(html);
          } 
        }).finally(() => {
          instance.enable();
          instance.show();
        });
      }
    }, function(instance) {
    });
  }
      let selectedAnnoteEl;
      const selectorForAnnotation = ( cell, annotation) => {
        let cellAttr = 'data-code-cell="' + cell + '"';
        let lineAttr = 'data-code-annotation="' +  annotation + '"';
        const selector = 'span[' + cellAttr + '][' + lineAttr + ']';
        return selector;
      }
      const selectCodeLines = (annoteEl) => {
        const doc = window.document;
        const targetCell = annoteEl.getAttribute("data-target-cell");
        const targetAnnotation = annoteEl.getAttribute("data-target-annotation");
        const annoteSpan = window.document.querySelector(selectorForAnnotation(targetCell, targetAnnotation));
        const lines = annoteSpan.getAttribute("data-code-lines").split(",");
        const lineIds = lines.map((line) => {
          return targetCell + "-" + line;
        })
        let top = null;
        let height = null;
        let parent = null;
        if (lineIds.length > 0) {
            //compute the position of the single el (top and bottom and make a div)
            const el = window.document.getElementById(lineIds[0]);
            top = el.offsetTop;
            height = el.offsetHeight;
            parent = el.parentElement.parentElement;
          if (lineIds.length > 1) {
            const lastEl = window.document.getElementById(lineIds[lineIds.length - 1]);
            const bottom = lastEl.offsetTop + lastEl.offsetHeight;
            height = bottom - top;
          }
          if (top !== null && height !== null && parent !== null) {
            // cook up a div (if necessary) and position it 
            let div = window.document.getElementById("code-annotation-line-highlight");
            if (div === null) {
              div = window.document.createElement("div");
              div.setAttribute("id", "code-annotation-line-highlight");
              div.style.position = 'absolute';
              parent.appendChild(div);
            }
            div.style.top = top - 2 + "px";
            div.style.height = height + 4 + "px";
            div.style.left = 0;
            let gutterDiv = window.document.getElementById("code-annotation-line-highlight-gutter");
            if (gutterDiv === null) {
              gutterDiv = window.document.createElement("div");
              gutterDiv.setAttribute("id", "code-annotation-line-highlight-gutter");
              gutterDiv.style.position = 'absolute';
              const codeCell = window.document.getElementById(targetCell);
              const gutter = codeCell.querySelector('.code-annotation-gutter');
              gutter.appendChild(gutterDiv);
            }
            gutterDiv.style.top = top - 2 + "px";
            gutterDiv.style.height = height + 4 + "px";
          }
          selectedAnnoteEl = annoteEl;
        }
      };
      const unselectCodeLines = () => {
        const elementsIds = ["code-annotation-line-highlight", "code-annotation-line-highlight-gutter"];
        elementsIds.forEach((elId) => {
          const div = window.document.getElementById(elId);
          if (div) {
            div.remove();
          }
        });
        selectedAnnoteEl = undefined;
      };
        // Handle positioning of the toggle
    window.addEventListener(
      "resize",
      throttle(() => {
        elRect = undefined;
        if (selectedAnnoteEl) {
          selectCodeLines(selectedAnnoteEl);
        }
      }, 10)
    );
    function throttle(fn, ms) {
    let throttle = false;
    let timer;
      return (...args) => {
        if(!throttle) { // first call gets through
            fn.apply(this, args);
            throttle = true;
        } else { // all the others get throttled
            if(timer) clearTimeout(timer); // cancel #2
            timer = setTimeout(() => {
              fn.apply(this, args);
              timer = throttle = false;
            }, ms);
        }
      };
    }
      // Attach click handler to the DT
      const annoteDls = window.document.querySelectorAll('dt[data-target-cell]');
      for (const annoteDlNode of annoteDls) {
        annoteDlNode.addEventListener('click', (event) => {
          const clickedEl = event.target;
          if (clickedEl !== selectedAnnoteEl) {
            unselectCodeLines();
            const activeEl = window.document.querySelector('dt[data-target-cell].code-annotation-active');
            if (activeEl) {
              activeEl.classList.remove('code-annotation-active');
            }
            selectCodeLines(clickedEl);
            clickedEl.classList.add('code-annotation-active');
          } else {
            // Unselect the line
            unselectCodeLines();
            clickedEl.classList.remove('code-annotation-active');
          }
        });
      }
  const findCites = (el) => {
    const parentEl = el.parentElement;
    if (parentEl) {
      const cites = parentEl.dataset.cites;
      if (cites) {
        return {
          el,
          cites: cites.split(' ')
        };
      } else {
        return findCites(el.parentElement)
      }
    } else {
      return undefined;
    }
  };
  var bibliorefs = window.document.querySelectorAll('a[role="doc-biblioref"]');
  for (var i=0; i<bibliorefs.length; i++) {
    const ref = bibliorefs[i];
    const citeInfo = findCites(ref);
    if (citeInfo) {
      tippyHover(citeInfo.el, function() {
        var popup = window.document.createElement('div');
        citeInfo.cites.forEach(function(cite) {
          var citeDiv = window.document.createElement('div');
          citeDiv.classList.add('hanging-indent');
          citeDiv.classList.add('csl-entry');
          var biblioDiv = window.document.getElementById('ref-' + cite);
          if (biblioDiv) {
            citeDiv.innerHTML = biblioDiv.innerHTML;
          }
          popup.appendChild(citeDiv);
        });
        return popup.innerHTML;
      });
    }
  }
});
</script>
<nav class="page-navigation">
  <div class="nav-page nav-page-previous">
      <a href="./polynomials.html" class="pagination-link" aria-label="Polynomials">
        <i class="bi bi-arrow-left-short"></i> <span class="nav-page-text">Polynomials</span>
      </a>          
  </div>
  <div class="nav-page nav-page-next">
      <a href="./calculus.html" class="pagination-link" aria-label="Calculus">
        <span class="nav-page-text">Calculus</span> <i class="bi bi-arrow-right-short"></i>
      </a>
  </div>
</nav>
</div> <!-- /content -->




</body></html>